摘要:的包管理工具現(xiàn)在的火熱程度一點(diǎn)都沒有下降,而成為了前端必備工具,特別是的包庫(kù)已經(jīng)成為了前端必備的,即使你不接觸作為后端的存在,現(xiàn)在各種第三方包依然需要使用來管理,可以說一個(gè)現(xiàn)代化的前段工程如果不使用類似這樣的包管理工具的話,應(yīng)該不算一個(gè)大型
node的包管理工具npm
node現(xiàn)在的火熱程度一點(diǎn)都沒有下降,而成為了前端必備工具,特別是npm的包庫(kù)已經(jīng)成為了前端必備的,即使你不接觸node作為后端的存在,現(xiàn)在各種第三方包依然需要使用npm來管理,可以說一個(gè)現(xiàn)代化的前段工程如果不使用類似npm這樣的包管理工具的話,應(yīng)該不算一個(gè)大型工程。
npm使用官方網(wǎng)站:https://docs.npmjs.com/ ,npm的安裝什么的就不說了,node的大部分版本也都自帶了npm,npm管理者node的大部分包,開發(fā)者可以上傳自己寫的包供他人使用,也可以下載使用別人寫好的包進(jìn)行使用,
使用npm init 來進(jìn)行初始化一個(gè)項(xiàng)目,會(huì)生成一個(gè)package.json文件,而版本管理就依賴這個(gè)文件,官方給的樣例文件:
{ "version": "5.3.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ "install", "modules", "package manager", "package.json" ], "preferGlobal": true, "config": { "publishtest": false }, "homepage": "https://docs.npmjs.com/", "author": { "name": "Isaac Z. Schlueter", "email": "[email protected]", "url": "http://blog.izs.me" }, "repository": { "type": "git", "url": "git+https://github.com/npm/npm.git" }, "bugs": { "url": "https://github.com/npm/npm/issues" }, "directories": { "bin": "./bin", "doc": "./doc", "lib": "./lib", "man": "./man" }, "main": "./lib/npm.js", "bin": { "npm": "./bin/npm-cli.js", "npx": "./bin/npx-cli.js" }, "dependencies": { "JSONStream": "~1.3.1", "abbrev": "~1.1.0", "ansi-regex": "~3.0.0", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "aproba": "~1.1.2", "archy": "~1.0.0", "bluebird": "~3.5.0", "cacache": "~9.2.9", "call-limit": "~1.1.0", "chownr": "~1.0.1", "cmd-shim": "~2.0.2", "columnify": "~1.5.4", "config-chain": "~1.1.11", "detect-indent": "~5.0.0", "dezalgo": "~1.0.3", "editor": "~1.0.0", "fs-vacuum": "~1.2.10", "fs-write-stream-atomic": "~1.0.10", "fstream": "~1.0.11", "fstream-npm": "~1.2.1", "glob": "~7.1.2", "graceful-fs": "~4.1.11", "has-unicode": "~2.0.1", "hosted-git-info": "~2.5.0", "iferr": "~0.1.5", "inflight": "~1.0.6", "inherits": "~2.0.3", "ini": "~1.3.4", "init-package-json": "~1.10.1", "lazy-property": "~1.0.0", "libnpx": "~9.2.0", "lockfile": "~1.0.3", "lodash._baseuniq": "~4.6.0", "lodash.clonedeep": "~4.5.0", "lodash.union": "~4.6.0", "lodash.uniq": "~4.5.0", "lodash.without": "~4.4.0", "lru-cache": "~4.1.1", "mississippi": "~1.3.0", "mkdirp": "~0.5.1", "move-concurrently": "~1.0.1", "node-gyp": "~3.6.2", "nopt": "~4.0.1", "normalize-package-data": "~2.4.0", "npm-cache-filename": "~1.0.2", "npm-install-checks": "~3.0.0", "npm-package-arg": "~5.1.2", "npm-registry-client": "~8.4.0", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", "opener": "~1.4.3", "osenv": "~0.1.4", "pacote": "~2.7.38", "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "read": "~1.0.7", "read-cmd-shim": "~1.0.1", "read-installed": "~4.0.3", "read-package-json": "~2.0.10", "read-package-tree": "~5.1.6", "readable-stream": "~2.3.3", "request": "~2.81.0", "retry": "~0.10.1", "rimraf": "~2.6.1", "safe-buffer": "~5.1.1", "semver": "~5.3.0", "sha": "~2.0.1", "slide": "~1.1.6", "sorted-object": "~2.0.1", "sorted-union-stream": "~2.1.3", "ssri": "~4.1.6", "strip-ansi": "~4.0.0", "tar": "~2.2.1", "text-table": "~0.2.0", "uid-number": "0.0.6", "umask": "~1.1.0", "unique-filename": "~1.1.0", "unpipe": "~1.0.0", "update-notifier": "~2.2.0", "uuid": "~3.1.0", "validate-npm-package-name": "~3.0.0", "which": "~1.2.14", "worker-farm": "~1.4.1", "wrappy": "~1.0.2", "write-file-atomic": "~2.1.0", "debuglog": "*", "imurmurhash": "*", "lodash._baseindexof": "*", "lodash._bindcallback": "*", "lodash._cacheindexof": "*", "lodash._createcache": "*", "lodash._getnative": "*", "lodash.restparam": "*", "readdir-scoped-modules": "*", "validate-npm-package-license": "*" }, "bundleDependencies": [ "abbrev", "ansi-regex", "ansicolors", "ansistyles", "aproba", "archy", "cacache", "call-limit", "bluebird", "chownr", "cmd-shim", "columnify", "config-chain", "debuglog", "detect-indent", "dezalgo", "editor", "fs-vacuum", "fs-write-stream-atomic", "fstream", "fstream-npm", "glob", "graceful-fs", "has-unicode", "hosted-git-info", "iferr", "imurmurhash", "inflight", "inherits", "ini", "init-package-json", "JSONStream", "lazy-property", "lockfile", "lodash._baseindexof", "lodash._baseuniq", "lodash._bindcallback", "lodash._cacheindexof", "lodash._createcache", "lodash._getnative", "lodash.clonedeep", "lodash.restparam", "lodash.union", "lodash.uniq", "lodash.without", "lru-cache", "mkdirp", "mississippi", "move-concurrently", "node-gyp", "nopt", "normalize-package-data", "npm-cache-filename", "npm-install-checks", "npm-package-arg", "npm-registry-client", "npm-user-validate", "npmlog", "once", "opener", "osenv", "pacote", "path-is-inside", "promise-inflight", "read", "read-cmd-shim", "read-installed", "read-package-json", "read-package-tree", "readable-stream", "readdir-scoped-modules", "request", "retry", "rimraf", "semver", "sha", "slide", "sorted-object", "sorted-union-stream", "ssri", "strip-ansi", "tar", "text-table", "uid-number", "umask", "unique-filename", "unpipe", "update-notifier", "uuid", "validate-npm-package-license", "validate-npm-package-name", "which", "wrappy", "write-file-atomic", "safe-buffer", "worker-farm", "libnpx" ], "devDependencies": { "deep-equal": "~1.0.1", "marked": "~0.3.6", "marked-man": "~0.2.1", "npm-registry-couchapp": "~2.6.13", "npm-registry-mock": "~1.1.0", "require-inject": "~1.4.2", "sprintf-js": "~1.1.1", "standard": "~6.0.8", "tacks": "~1.2.6", "tap": "~10.7.0" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", "prepare": "node bin/npm-cli.js --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc", "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m "update AUTHORS" || true", "tap": "tap --timeout 300", "tap-cover": "tap --nyc-arg="--cache" --coverage --timeout 600", "test": "standard && npm run test-tap", "test-coverage": "npm run tap-cover -- "test/tap/*.js" "test/network/*.js" "test/broken-under-*/*.js"", "test-tap": "npm run tap -- "test/tap/*.js" "test/network/*.js" "test/broken-under-*/*.js"", "test-node": "tap --timeout 240 "test/tap/*.js" "test/network/*.js" "test/broken-under-nyc*/*.js"" }, "license": "Artistic-2.0", "contributors": [ { "name": "Isaac Z. Schlueter", "email": "[email protected]" }, { "name": "Steve Steiner", "email": "[email protected]" }, { "name": "Mikeal Rogers", "email": "[email protected]" }, { "name": "Aaron Blohowiak", "email": "[email protected]" }, { "name": "Martyn Smith", "email": "[email protected]" }, { "name": "Charlie Robbins", "email": "[email protected]" }, { "name": "Francisco Treacy", "email": "[email protected]" }, { "name": "Cliffano Subagio", "email": "[email protected]" }, { "name": "Christian Eager", "email": "[email protected]" }, { "name": "Dav Glass", "email": "[email protected]" }, { "name": "Alex K. Wolfe", "email": "[email protected]" }, { "name": "James Sanders", "email": "[email protected]" }, { "name": "Reid Burke", "email": "[email protected]" }, { "name": "Arlo Breault", "email": "[email protected]" }, { "name": "Timo Derstappen", "email": "[email protected]" }, { "name": "Bart Teeuwisse", "email": "[email protected]" }, { "name": "Ben Noordhuis", "email": "[email protected]" }, { "name": "Tor Valamo", "email": "[email protected]" }, { "name": "Whyme.Lyu", "email": "[email protected]" }, { "name": "Olivier Melcher", "email": "[email protected]" }, { "name": "Toma啪 Muraus", "email": "[email protected]" }, { "name": "Evan Meagher", "email": "[email protected]" }, { "name": "Orlando Vazquez", "email": "[email protected]" }, { "name": "Kai Chen", "email": "[email protected]" }, { "name": "George Miroshnykov", "email": "[email protected]" }, { "name": "Geoff Flarity", "email": "[email protected]" }, { "name": "Max Goodman", "email": "[email protected]" }, { "name": "Pete Kruckenberg", "email": "[email protected]" }, { "name": "Laurie Harper", "email": "[email protected]" }, { "name": "Chris Wong", "email": "[email protected]" }, { "name": "Scott Bronson", "email": "[email protected]" }, { "name": "Federico Romero", "email": "[email protected]" }, { "name": "Visnu Pitiyanuvath", "email": "[email protected]" }, { "name": "Irakli Gozalishvili", "email": "[email protected]" }, { "name": "Mark Cahill", "email": "[email protected]" }, { "name": "Tony", "email": "[email protected]" }, { "name": "Iain Sproat", "email": "[email protected]" }, { "name": "Trent Mick", "email": "[email protected]" }, { "name": "Felix Geisendo虉rfer", "email": "[email protected]" }, { "name": "Jameson Little", "email": "[email protected]" }, { "name": "Conny Brunnkvist", "email": "[email protected]" }, { "name": "Will Elwood", "email": "[email protected]" }, { "name": "Dean Landolt", "email": "[email protected]" }, { "name": "Oleg Efimov", "email": "[email protected]" }, { "name": "Martin Cooper", "email": "[email protected]" }, { "name": "Jann Horn", "email": "[email protected]" }, { "name": "Andrew Bradley", "email": "[email protected]" }, { "name": "Maciej Ma艂ecki", "email": "[email protected]" }, { "name": "Stephen Sugden", "email": "[email protected]" }, { "name": "Michael Budde", "email": "[email protected]" }, { "name": "Jason Smith", "email": "[email protected]" }, { "name": "Gautham Pai", "email": "[email protected]" }, { "name": "David Trejo", "email": "[email protected]" }, { "name": "Paul Vorbach", "email": "[email protected]" }, { "name": "George Ornbo", "email": "[email protected]" }, { "name": "Tim Oxley", "email": "[email protected]" }, { "name": "Tyler Green", "email": "[email protected]" }, { "name": "Dave Pacheco", "email": "[email protected]" }, { "name": "Danila Gerasimov", "email": "[email protected]" }, { "name": "Rod Vagg", "email": "[email protected]" }, { "name": "Christian Howe", "email": "[email protected]" }, { "name": "Andrew Lunny", "email": "[email protected]" }, { "name": "Henrik Hodne", "email": "[email protected]" }, { "name": "Adam Blackburn", "email": "[email protected]" }, { "name": "Kris Windham", "email": "[email protected]" }, { "name": "Jens Grunert", "email": "[email protected]" }, { "name": "Joost-Wim Boekesteijn", "email": "[email protected]" }, { "name": "Dalmais Maxence", "email": "[email protected]" }, { "name": "Marcus Ekwall", "email": "[email protected]" }, { "name": "Aaron Stacy", "email": "[email protected]" }, { "name": "Phillip Howell", "email": "[email protected]" }, { "name": "Domenic Denicola", "email": "[email protected]" }, { "name": "James Halliday", "email": "[email protected]" }, { "name": "Jeremy Cantrell", "email": "[email protected]" }, { "name": "Ribettes", "email": "[email protected]" }, { "name": "Don Park", "email": "[email protected]" }, { "name": "Einar Otto Stangvik", "email": "[email protected]" }, { "name": "Kei Son", "email": "[email protected]" }, { "name": "Nicolas Morel", "email": "[email protected]" }, { "name": "Mark Dube", "email": "[email protected]" }, { "name": "Nathan Rajlich", "email": "[email protected]" }, { "name": "Maxim Bogushevich", "email": "[email protected]" }, { "name": "Meaglin", "email": "[email protected]" }, { "name": "Ben Evans", "email": "[email protected]" }, { "name": "Nathan Zadoks", "email": "[email protected]" }, { "name": "Brian White", "email": "[email protected]" }, { "name": "Jed Schmidt", "email": "[email protected]" }, { "name": "Ian Livingstone", "email": "[email protected]" }, { "name": "Patrick Pfeiffer", "email": "[email protected]" }, { "name": "Paul Miller", "email": "[email protected]" }, { "name": "Ryan Emery", "email": "[email protected]" }, { "name": "Carl Lange", "email": "[email protected]" }, { "name": "Jan Lehnardt", "email": "[email protected]" }, { "name": "Stuart P. Bentley", "email": "[email protected]" }, { "name": "Johan Sk枚ld", "email": "[email protected]" }, { "name": "Stuart Knightley", "email": "[email protected]" }, { "name": "Niggler", "email": "[email protected]" }, { "name": "Paolo Fragomeni", "email": "[email protected]" }, { "name": "Jaakko Manninen", "email": "[email protected]" }, { "name": "Luke Arduini", "email": "[email protected]" }, { "name": "Larz Conwell", "email": "larz@larz-laptop.(none)", "url": "none" }, { "name": "Marcel Klehr", "email": "[email protected]" }, { "name": "Robert Kowalski", "email": "[email protected]" }, { "name": "Forbes Lindesay", "email": "[email protected]" }, { "name": "Vaz Allen", "email": "[email protected]" }, { "name": "Jake Verbaten", "email": "[email protected]" }, { "name": "Schabse Laks", "email": "[email protected]" }, { "name": "Florian Margaine", "email": "[email protected]" }, { "name": "Johan Nordberg", "email": "[email protected]" }, { "name": "Ian Babrou", "email": "[email protected]" }, { "name": "Di Wu", "email": "[email protected]" }, { "name": "Mathias Bynens", "email": "[email protected]" }, { "name": "Matt McClure", "email": "[email protected]" }, { "name": "Matt Lunn", "email": "[email protected]" }, { "name": "Alexey Kreschuk", "email": "[email protected]" }, { "name": "elisee", "email": "[email protected]" }, { "name": "Robert Gieseke", "email": "[email protected]" }, { "name": "Franc抬ois Frisch", "email": "[email protected]" }, { "name": "Trevor Burnham", "email": "[email protected]" }, { "name": "Alan Shaw", "email": "[email protected]" }, { "name": "TJ Holowaychuk", "email": "[email protected]" }, { "name": "Nicholas Kinsey", "email": "[email protected]" }, { "name": "Paulo Cesar", "email": "[email protected]" }, { "name": "Elan Shanker", "email": "[email protected]" }, { "name": "Jon Spencer", "email": "[email protected]" }, { "name": "Jason Diamond", "email": "[email protected]" }, { "name": "Maximilian Antoni", "email": "[email protected]" }, { "name": "Thom Blake", "email": "[email protected]" }, { "name": "Jess Martin", "email": "[email protected]" }, { "name": "Spain Train", "email": "[email protected]" }, { "name": "Alex Rodionov", "email": "[email protected]" }, { "name": "Matt Colyer", "email": "[email protected]" }, { "name": "Evan You", "email": "[email protected]" }, { "name": "bitspill", "email": "[email protected]" }, { "name": "Gabriel Falkenberg", "email": "[email protected]" }, { "name": "Alexej Yaroshevich", "email": "[email protected]" }, { "name": "Quim Calpe", "email": "[email protected]" }, { "name": "Steve Mason", "email": "[email protected]" }, { "name": "Wil Moore III", "email": "[email protected]" }, { "name": "Sergey Belov", "email": "[email protected]" }, { "name": "Tom Huang", "email": "[email protected]" }, { "name": "CamilleM", "email": "[email protected]" }, { "name": "S茅bastien Santoro", "email": "[email protected]" }, { "name": "Evan Lucas", "email": "[email protected]" }, { "name": "Quinn Slack", "email": "[email protected]" }, { "name": "Alex Kocharin", "email": "[email protected]" }, { "name": "Daniel Santiago", "email": "[email protected]" }, { "name": "Denis Gladkikh", "email": "[email protected]" }, { "name": "Andrew Horton", "email": "[email protected]" }, { "name": "Zeke Sikelianos", "email": "[email protected]" }, { "name": "Dylan Greene", "email": "[email protected]" }, { "name": "Franck Cuny", "email": "[email protected]" }, { "name": "Yeonghoon Park", "email": "[email protected]" }, { "name": "Rafael de Oleza", "email": "[email protected]" }, { "name": "Mikola Lysenko", "email": "[email protected]" }, { "name": "Yazhong Liu", "email": "[email protected]" }, { "name": "Neil Gentleman", "email": "[email protected]" }, { "name": "Kris Kowal", "email": "[email protected]" }, { "name": "Alex Gorbatchev", "email": "[email protected]" }, { "name": "Shawn Wildermuth", "email": "[email protected]" }, { "name": "Wesley de Souza", "email": "[email protected]" }, { "name": "yoyoyogi", "email": "[email protected]" }, { "name": "J. Tangelder", "email": "[email protected]" }, { "name": "Jean Lauliac", "email": "[email protected]" }, { "name": "Andrey Kislyuk", "email": "[email protected]" }, { "name": "Thorsten Lorenz", "email": "[email protected]" }, { "name": "Julian Gruber", "email": "[email protected]" }, { "name": "Benjamin Coe", "email": "[email protected]" }, { "name": "Alex Ford", "email": "[email protected]" }, { "name": "Matt Hickford", "email": "[email protected]" }, { "name": "Sean McGivern", "email": "[email protected]" }, { "name": "C J Silverio", "email": "[email protected]" }, { "name": "Robin Tweedie", "email": "[email protected]" }, { "name": "Miroslav Bajto擰", "email": "[email protected]" }, { "name": "David Glasser", "email": "[email protected]" }, { "name": "Gianluca Casati", "email": "[email protected]" }, { "name": "Forrest L Norvell", "email": "[email protected]" }, { "name": "Karsten Tinnefeld", "email": "[email protected]" }, { "name": "Bryan Burgers", "email": "[email protected]" }, { "name": "David Beitey", "email": "[email protected]" }, { "name": "Evan You", "email": "[email protected]" }, { "name": "Zach Pomerantz", "email": "[email protected]" }, { "name": "Chris Williams", "email": "[email protected]" }, { "name": "sudodoki", "email": "[email protected]" }, { "name": "Mick Thompson", "email": "[email protected]" }, { "name": "Felix Rabe", "email": "[email protected]" }, { "name": "Michael Hayes", "email": "[email protected]" }, { "name": "Chris Dickinson", "email": "[email protected]" }, { "name": "Bradley Meck", "email": "[email protected]" }, { "name": "GeJ", "email": "[email protected]" }, { "name": "Andrew Terris", "email": "[email protected]" }, { "name": "Michael Nisi", "email": "[email protected]" }, { "name": "fengmk2", "email": "[email protected]" }, { "name": "Adam Meadows", "email": "[email protected]" }, { "name": "Chulki Lee", "email": "[email protected]" }, { "name": "涓嶅洓", "email": "[email protected]" }, { "name": "dead_horse", "email": "[email protected]" }, { "name": "Kenan Yildirim", "email": "[email protected]" }, { "name": "Laurie Voss", "email": "[email protected]" }, { "name": "Rebecca Turner", "email": "[email protected]" }, { "name": "Hunter Loftis", "email": "[email protected]" }, { "name": "Peter Richardson", "email": "[email protected]" }, { "name": "Jussi Kalliokoski", "email": "[email protected]" }, { "name": "Filip Weiss", "email": "[email protected]" }, { "name": "Timo Wei脽", "email": "[email protected]" }, { "name": "Christopher Hiller", "email": "[email protected]" }, { "name": "J茅r茅my Lal", "email": "[email protected]" }, { "name": "Anders Janmyr", "email": "[email protected]" }, { "name": "Chris Meyers", "email": "[email protected]" }, { "name": "Ludwig Magnusson", "email": "[email protected]" }, { "name": "Wout Mertens", "email": "[email protected]" }, { "name": "Nick Santos", "email": "[email protected]" }, { "name": "Terin Stock", "email": "[email protected]" }, { "name": "Faiq Raza", "email": "[email protected]" }, { "name": "Thomas Torp", "email": "[email protected]" }, { "name": "Sam Mikes", "email": "[email protected]" }, { "name": "Mat Tyndall", "email": "[email protected]" }, { "name": "Tauren Mills", "email": "[email protected]" }, { "name": "Ron Martinez", "email": "[email protected]" }, { "name": "Kazuhito Hokamura", "email": "[email protected]" }, { "name": "Tristan Davies", "email": "[email protected]" }, { "name": "David Volm", "email": "[email protected]" }, { "name": "Lin Clark", "email": "[email protected]" }, { "name": "Ben Page", "email": "[email protected]" }, { "name": "Jeff Jo", "email": "[email protected]" }, { "name": "martinvd", "email": "[email protected]" }, { "name": "Mark J. Titorenko", "email": "[email protected]" }, { "name": "Oddur Sigurdsson", "email": "[email protected]" }, { "name": "Eric Mill", "email": "[email protected]" }, { "name": "Gabriel Barros", "email": "[email protected]" }, { "name": "KevinSheedy", "email": "[email protected]" }, { "name": "Aleksey Smolenchuk", "email": "[email protected]" }, { "name": "Ed Morley", "email": "[email protected]" }, { "name": "Blaine Bublitz", "email": "[email protected]" }, { "name": "Andrey Fedorov", "email": "[email protected]" }, { "name": "Daijiro Wachi", "email": "[email protected]" }, { "name": "Luc Thevenard", "email": "[email protected]" }, { "name": "Aria Stewart", "email": "[email protected]" }, { "name": "Charlie Rudolph", "email": "[email protected]" }, { "name": "Vladimir Rutsky", "email": "[email protected]" }, { "name": "Isaac Murchie", "email": "[email protected]" }, { "name": "Marcin Wosinek", "email": "[email protected]" }, { "name": "David Marr", "email": "[email protected]" }, { "name": "Bryan English", "email": "[email protected]" }, { "name": "Anthony Zotti", "email": "[email protected]" }, { "name": "Karl Horky", "email": "[email protected]" }, { "name": "Jordan Harband", "email": "[email protected]" }, { "name": "Gu冒l(fā)augur Stef謾n Egilsson", "email": "[email protected]" }, { "name": "Helge Skogly Holm", "email": "[email protected]" }, { "name": "Peter A. Shevtsov", "email": "[email protected]" }, { "name": "Alain Kalker", "email": "[email protected]" }, { "name": "Bryant Williams", "email": "[email protected]" }, { "name": "Jonas Weber", "email": "[email protected]" }, { "name": "Tim Whidden", "email": "[email protected]" }, { "name": "Andreas", "email": "[email protected]" }, { "name": "Karolis Narkevicius", "email": "[email protected]" }, { "name": "Adrian Lynch", "email": "[email protected]" }, { "name": "Richard Littauer", "email": "[email protected]" }, { "name": "Oli Evans", "email": "[email protected]" }, { "name": "Matt Brennan", "email": "[email protected]" }, { "name": "Jeff Barczewski", "email": "[email protected]" }, { "name": "Danny Fritz", "email": "[email protected]" }, { "name": "Takaya Kobayashi", "email": "[email protected]" }, { "name": "Ra"Shaun Stovall", "email": "[email protected]" }, { "name": "Julien Meddah", "email": "[email protected]" }, { "name": "Michiel Sikma", "email": "[email protected]" }, { "name": "Jakob Krigovsky", "email": "[email protected]" }, { "name": "Charmander", "email": "[email protected]" }, { "name": "Erik Wienhold", "email": "[email protected]" }, { "name": "James Butler", "email": "[email protected]" }, { "name": "Kevin Kragenbrink", "email": "[email protected]" }, { "name": "Arnaud Rinquin", "email": "[email protected]" }, { "name": "Mike MacCana", "email": "[email protected]" }, { "name": "Antti Mattila", "email": "[email protected]" }, { "name": "laiso", "email": "[email protected]" }, { "name": "Matt Zorn", "email": "[email protected]" }, { "name": "Kyle Mitchell", "email": "[email protected]" }, { "name": "Jeremiah Senkpiel", "email": "[email protected]" }, { "name": "Michael Klein", "email": "[email protected]" }, { "name": "Simen Bekkhus", "email": "[email protected]" }, { "name": "Victor", "email": "[email protected]" }, { "name": "thefourtheye", "email": "[email protected]" }, { "name": "Clay Carpenter", "email": "[email protected]" }, { "name": "bangbang93", "email": "[email protected]" }, { "name": "Nick Malaguti", "email": "[email protected]" }, { "name": "Cedric Nelson", "email": "[email protected]" }, { "name": "Kat March謾n", "email": "[email protected]" }, { "name": "Andrew", "email": "[email protected]" }, { "name": "Eduardo Pinho", "email": "[email protected]" }, { "name": "Rachel Hutchison", "email": "[email protected]" }, { "name": "Ryan Temple", "email": "[email protected]" }, { "name": "Eugene Sharygin", "email": "[email protected]" }, { "name": "James Talmage", "email": "[email protected]" }, { "name": "jane arc", "email": "[email protected]" }, { "name": "Joseph Dykstra", "email": "[email protected]" }, { "name": "Andrew Crites", "email": "[email protected]" }, { "name": "Joshua Egan", "email": "[email protected]" }, { "name": "Carlos Alberto", "email": "[email protected]" }, { "name": "Thomas Cort", "email": "[email protected]" }, { "name": "Thaddee Tyl", "email": "[email protected]" }, { "name": "Steve Klabnik", "email": "[email protected]" }, { "name": "Andrew Murray", "email": "[email protected]" }, { "name": "Stephan B枚nnemann", "email": "[email protected]" }, { "name": "Kyle M. Tarplee", "email": "[email protected]" }, { "name": "Derek Peterson", "email": "[email protected]" }, { "name": "Greg Whiteley", "email": "[email protected]" }, { "name": "murgatroid99", "email": "[email protected]" }, { "name": "Marcin Cieslak", "email": "[email protected]" }, { "name": "Jo茫o Reis", "email": "[email protected]" }, { "name": "Matthew Hasbach", "email": "[email protected]" }, { "name": "Jon Hall", "email": "[email protected]" }, { "name": "Anna Henningsen", "email": "[email protected]" }, { "name": "James Treworgy", "email": "[email protected]" }, { "name": "James Hartig", "email": "[email protected]" }, { "name": "Stephanie Snopek", "email": "[email protected]" }, { "name": "Kent C. Dodds", "email": "[email protected]" }, { "name": "Aaron Krause", "email": "[email protected]" }, { "name": "Daniel K O"Leary", "email": "[email protected]" }, { "name": "fscherwi", "email": "[email protected]" }, { "name": "Thomas Reggi", "email": "[email protected]" }, { "name": "Thomas Michael McTiernan", "email": "[email protected]" }, { "name": "Jason Kurian", "email": "[email protected]" }, { "name": "Sebastiaan Deckers", "email": "[email protected]" }, { "name": "lady3bean", "email": "[email protected]" }, { "name": "Tomi Carr", "email": "[email protected]" }, { "name": "Juan Caicedo", "email": "[email protected]" }, { "name": "Ashley Williams", "email": "[email protected]" }, { "name": "Andrew Marcinkevi膷ius", "email": "[email protected]" }, { "name": "Jorrit Schippers", "email": "[email protected]" }, { "name": "Alex Lukin", "email": "[email protected]" }, { "name": "Aria Stewart", "email": "[email protected]" }, { "name": "Tiago Rodrigues", "email": "[email protected]" }, { "name": "Tim", "email": "[email protected]" }, { "name": "Nick Williams", "email": "[email protected]" }, { "name": "Louis Larry", "email": "[email protected]" }, { "name": "Ben Gotow", "email": "[email protected]" }, { "name": "Jakub Gieryluk", "email": "[email protected]" }, { "name": "Kevin Lorenz", "email": "[email protected]" }, { "name": "Martin von Gagern", "email": "[email protected]" }, { "name": "Eymen Gunay", "email": "[email protected]" }, { "name": "Martin Ek", "email": "[email protected]" }, { "name": "Rafa艂 Pocztarski", "email": "[email protected]" }, { "name": "Mark Reeder", "email": "[email protected]" }, { "name": "Chris Rebert", "email": "[email protected]" }, { "name": "Scott Addie", "email": "[email protected]" }, { "name": "Jeff McMahan", "email": "[email protected]" }, { "name": "Tim Krins", "email": "[email protected]" }, { "name": "Hal Henke", "email": "[email protected]" }, { "name": "Julian Simioni", "email": "[email protected]" }, { "name": "Jimb Esser", "email": "[email protected]" }, { "name": "Alexis Campailla", "email": "[email protected]" }, { "name": "Chris Chua", "email": "[email protected]" }, { "name": "Beau Gunderson", "email": "[email protected]" }, { "name": "Dave Galbraith", "email": "[email protected]" }, { "name": "s100", "email": "[email protected]" }, { "name": "Sergey Simonchik", "email": "[email protected]" }, { "name": "Vanja Radovanovi膰", "email": "[email protected]" }, { "name": "Jonathan Persson", "email": "[email protected]" }, { "name": "Vedat Mahir YILMAZ", "email": "[email protected]" }, { "name": "Samuel Reed", "email": "[email protected]" }, { "name": "Rafa艂 Legi臋d藕", "email": "[email protected]" }, { "name": "Jan Sch盲r", "email": "[email protected]" }, { "name": "Xcat Liu", "email": "[email protected]" }, { "name": "harryh", "email": "[email protected]" }, { "name": "Prayag Verma", "email": "[email protected]" }, { "name": "Neil Kistner", "email": "[email protected]" }, { "name": "Zoujie Wzj", "email": "[email protected]" }, { "name": "Ryan Hendrickson", "email": "[email protected]" }, { "name": "Arturo Coronel", "email": "[email protected]" }, { "name": "Hutson Betts", "email": "[email protected]" }, { "name": "Lewis Cowper", "email": "[email protected]" }, { "name": "Adam Byrne", "email": "[email protected]" }, { "name": "Ifeanyi Oraelosi", "email": "[email protected]" }, { "name": "Robert Ludwig", "email": "[email protected]" }, { "name": "Chris Warren", "email": "[email protected]" }, { "name": "Scott Plumlee", "email": "[email protected]" }, { "name": "Daniel Pedersen", "email": "[email protected]" }, { "name": "rhgb", "email": "[email protected]" }, { "name": "doug.wade", "email": "[email protected]" }, { "name": "Zac", "email": "[email protected]" }, { "name": "GriffinSchneider", "email": "[email protected]" }, { "name": "Andres Kalle", "email": "[email protected]" }, { "name": "thefourtheye", "email": "[email protected]" }, { "name": "Yael", "email": "[email protected]" }, { "name": "Yann Odeyer", "email": "[email protected]" }, { "name": "James Monger", "email": "[email protected]" }, { "name": "Thomas Hallock", "email": "[email protected]" }, { "name": "Paul Irish", "email": "[email protected]" }, { "name": "Paul O"Leary McCann", "email": "[email protected]" }, { "name": "Francis Gulotta", "email": "[email protected]" }, { "name": "Felix Rieseberg", "email": "[email protected]" }, { "name": "Glen Mailer", "email": "[email protected]" }, { "name": "Federico Brigante", "email": "[email protected]" }, { "name": "Steve Mao", "email": "[email protected]" }, { "name": "Anna Henningsen", "email": "[email protected]" }, { "name": "Rachel Evans", "email": "[email protected]" }, { "name": "Sam Minnee", "email": "[email protected]" }, { "name": "Zirak", "email": "[email protected]" }, { "name": "Daniel Lupu", "email": "[email protected]" }, { "name": "Gianluca Casati", "email": "[email protected]" }, { "name": "Andr茅 Herculano", "email": "[email protected]" }, { "name": "Wyatt Preul", "email": "[email protected]" }, { "name": "Myles Borins", "email": "[email protected]" }, { "name": "Elliot Lee", "email": "[email protected]" }, { "name": "Dmitry Kirilyuk", "email": "[email protected]" }, { "name": "Aaron Tribou", "email": "[email protected]" }, { "name": "Tapani Moilanen", "email": "[email protected]" }, { "name": "Han Seoul-Oh", "email": "[email protected]" }, { "name": "Aleksey Shvayka", "email": "[email protected]" }, { "name": "Emma Ramirez", "email": "[email protected]" }, { "name": "Julian Duque", "email": "[email protected]" }, { "name": "Simon MacDonald", "email": "[email protected]" }, { "name": "Adam Stankiewicz", "email": "[email protected]" }, { "name": "Gregers Gram Rygg", "email": "[email protected]" }, { "name": "Peter Dave Hello", "email": "[email protected]" }, { "name": "Jordan Klassen", "email": "[email protected]" }, { "name": "Jason Palmer", "email": "[email protected]" }, { "name": "Michael Hart", "email": "[email protected]" }, { "name": "Sasha Koss", "email": "[email protected]" }, { "name": "David Emmerson", "email": "[email protected]" }, { "name": "Christophe Hurpeau", "email": "[email protected]" }, { "name": "Daniel Paz-Soldan", "email": "[email protected]" }, { "name": "Sakthipriyan Vairamani", "email": "[email protected]" }, { "name": "Zach Renner", "email": "[email protected]" }, { "name": "Christopher Hiller", "email": "[email protected]" }, { "name": "legodude17", "email": "[email protected]" }, { "name": "Andrew Meyer", "email": "[email protected]" }, { "name": "Michael Jasper", "email": "[email protected]" }, { "name": "Max", "email": "[email protected]" }, { "name": "Szymon Nowak", "email": "[email protected]" }, { "name": "Jason Karns", "email": "[email protected]" }, { "name": "Lucas Holmquist", "email": "[email protected]" }, { "name": "Ionic膬 Biz膬u", "email": "[email protected]" }, { "name": "Alex Chesters", "email": "[email protected]" }, { "name": "Robert Gay", "email": "[email protected]" }, { "name": "Steven", "email": "[email protected]" }, { "name": "Tim Caswell", "email": "[email protected]" }, { "name": "Anna Henningsen", "email": "[email protected]" }, { "name": "Kim R酶en", "email": "[email protected]" }, { "name": "Douglas Wilson", "email": "[email protected]" }, { "name": "Mike Engel", "email": "[email protected]" }, { "name": "baderbuddy", "email": "[email protected]" }, { "name": "Alex Jordan", "email": "[email protected]" }, { "name": "Ville Lahdenvuo", "email": "[email protected]" }, { "name": "Natalie Wolfe", "email": "[email protected]" }, { "name": "Andrew Schmadel", "email": "[email protected]" }, { "name": "Jonah Moses", "email": "[email protected]" }, { "name": "Daijir艒 Wachi", "email": "[email protected]" }, { "name": "Dmitry Litvinchenko", "email": "[email protected]" }, { "name": "chocolateboy", "email": "[email protected]" }, { "name": "Henry Zhu", "email": "[email protected]" }, { "name": "Nate Goldman", "email": "[email protected]" }, { "name": "Ted Yavuzkurt", "email": "[email protected]" }, { "name": "Arseniy Maximov", "email": "[email protected]" }, { "name": "Joshua Bennett", "email": "[email protected]" }, { "name": "Evgeny Kulikov", "email": "[email protected]" }, { "name": "小瀉芯脅芯褉芯寫邪 袧懈瀉懈褌邪 袗薪寫褉械械脅懈褔", "email": "[email protected]" }, { "name": "Carol", "email": "[email protected]", "url": "Nichols || Goulding" }, { "name": "Jarid Margolin", "email": "[email protected]" }, { "name": "David Cook", "email": "[email protected]" }, { "name": "Brian Dukes", "email": "[email protected]" }, { "name": "J F", "email": "[email protected]" }, { "name": "Pavlo Liulia", "email": "[email protected]" }, { "name": "J謾n Dzurek", "email": "[email protected]" }, { "name": "Lucas Theisen", "email": "[email protected]" }, { "name": "Mike Sherov", "email": "[email protected]" }, { "name": "钖涘畾璋旂殑鐚?", "email": "[email protected]" }, { "name": "Pawe艂 Lula", "email": "[email protected]" }, { "name": "Jakob Krigovsky", "email": "[email protected]" }, { "name": "George Rawlinson", "email": "[email protected]" }, { "name": "Jack Nagel", "email": "[email protected]" }, { "name": "Andreas Kohn", "email": "[email protected]" }, { "name": "Jason Wohlgemuth", "email": "[email protected]" }, { "name": "Ryan Graham", "email": "[email protected]" }, { "name": "Hirse", "email": "[email protected]" }, { "name": "Colin Rotherham", "email": "[email protected]" }, { "name": "Aki", "email": "[email protected]" }, { "name": "Emily Marigold Klassen", "email": "[email protected]" }, { "name": "Ramana Venkata", "email": "[email protected]" }, { "name": "kierendixon", "email": "[email protected]" }, { "name": "R謾cz Tibor Zolt謾n", "email": "[email protected]" }, { "name": "Guangcong Luo", "email": "[email protected]" }, { "name": "Steven", "email": "[email protected]" }, { "name": "Jan Pilzer", "email": "[email protected]" }, { "name": "Leonard Martin", "email": "[email protected]" }, { "name": "Teddy Katz", "email": "[email protected]" }, { "name": "Simon Legg", "email": "[email protected]" }, { "name": "Kin Lum", "email": "[email protected]" }, { "name": "dax", "email": "[email protected]" }, { "name": "Jo啪e Mlakar", "email": "[email protected]" }, { "name": "happylynx", "email": "[email protected]" }, { "name": "Dominic Watson", "email": "[email protected]" }, { "name": "Enrico Weigelt, metux IT consult", "email": "[email protected]" }, { "name": "Brian Beck", "email": "[email protected]" }, { "name": "Ramana Venkata", "email": "[email protected]" }, { "name": "mmkal", "email": "[email protected]" }, { "name": "Andrew Schmadel", "email": "[email protected]" }, { "name": "AJ Jordan", "email": "[email protected]" }, { "name": "Mark Banner", "email": "[email protected]" }, { "name": "Richard Simko", "email": "[email protected]" }, { "name": "Sanketh Katta", "email": "[email protected]" }, { "name": "Tim Needham", "email": "[email protected]" }, { "name": "leonardo rojas", "email": "[email protected]" }, { "name": "Mark Peter Fejes", "email": "[email protected]" } ], "man": [ "/Users/zkat/Documents/code/npm/man/man1/npm-access.1", "/Users/zkat/Documents/code/npm/man/man1/npm-adduser.1", "/Users/zkat/Documents/code/npm/man/man1/npm-bin.1", "/Users/zkat/Documents/code/npm/man/man1/npm-bugs.1", "/Users/zkat/Documents/code/npm/man/man1/npm-build.1", "/Users/zkat/Documents/code/npm/man/man1/npm-bundle.1", "/Users/zkat/Documents/code/npm/man/man1/npm-cache.1", "/Users/zkat/Documents/code/npm/man/man1/npm-completion.1", "/Users/zkat/Documents/code/npm/man/man1/npm-config.1", "/Users/zkat/Documents/code/npm/man/man1/npm-dedupe.1", "/Users/zkat/Documents/code/npm/man/man1/npm-deprecate.1", "/Users/zkat/Documents/code/npm/man/man1/npm-dist-tag.1", "/Users/zkat/Documents/code/npm/man/man1/npm-docs.1", "/Users/zkat/Documents/code/npm/man/man1/npm-doctor.1", "/Users/zkat/Documents/code/npm/man/man1/npm-edit.1", "/Users/zkat/Documents/code/npm/man/man1/npm-explore.1", "/Users/zkat/Documents/code/npm/man/man1/npm-help-search.1", "/Users/zkat/Documents/code/npm/man/man1/npm-help.1", "/Users/zkat/Documents/code/npm/man/man1/npm-init.1", "/Users/zkat/Documents/code/npm/man/man1/npm-install-test.1", "/Users/zkat/Documents/code/npm/man/man1/npm-install.1", "/Users/zkat/Documents/code/npm/man/man1/npm-link.1", "/Users/zkat/Documents/code/npm/man/man1/npm-logout.1", "/Users/zkat/Documents/code/npm/man/man1/npm-ls.1", "/Users/zkat/Documents/code/npm/man/man1/npm-outdated.1", "/Users/zkat/Documents/code/npm/man/man1/npm-owner.1", "/Users/zkat/Documents/code/npm/man/man1/npm-pack.1", "/Users/zkat/Documents/code/npm/man/man1/npm-ping.1", "/Users/zkat/Documents/code/npm/man/man1/npm-prefix.1", "/Users/zkat/Documents/code/npm/man/man1/npm-prune.1", "/Users/zkat/Documents/code/npm/man/man1/npm-publish.1", "/Users/zkat/Documents/code/npm/man/man1/npm-README.1", "/Users/zkat/Documents/code/npm/man/man1/npm-rebuild.1", "/Users/zkat/Documents/code/npm/man/man1/npm-repo.1", "/Users/zkat/Documents/code/npm/man/man1/npm-restart.1", "/Users/zkat/Documents/code/npm/man/man1/npm-root.1", "/Users/zkat/Documents/code/npm/man/man1/npm-run-script.1", "/Users/zkat/Documents/code/npm/man/man1/npm-search.1", "/Users/zkat/Documents/code/npm/man/man1/npm-shrinkwrap.1", "/Users/zkat/Documents/code/npm/man/man1/npm-star.1", "/Users/zkat/Documents/code/npm/man/man1/npm-stars.1", "/Users/zkat/Documents/code/npm/man/man1/npm-start.1", "/Users/zkat/Documents/code/npm/man/man1/npm-stop.1", "/Users/zkat/Documents/code/npm/man/man1/npm-team.1", "/Users/zkat/Documents/code/npm/man/man1/npm-test.1", "/Users/zkat/Documents/code/npm/man/man1/npm-uninstall.1", "/Users/zkat/Documents/code/npm/man/man1/npm-unpublish.1", "/Users/zkat/Documents/code/npm/man/man1/npm-update.1", "/Users/zkat/Documents/code/npm/man/man1/npm-version.1", "/Users/zkat/Documents/code/npm/man/man1/npm-view.1", "/Users/zkat/Documents/code/npm/man/man1/npm-whoami.1", "/Users/zkat/Documents/code/npm/man/man1/npm.1", "/Users/zkat/Documents/code/npm/man/man1/npx.1", "/Users/zkat/Documents/code/npm/man/man5/npm-folders.5", "/Users/zkat/Documents/code/npm/man/man5/npm-global.5", "/Users/zkat/Documents/code/npm/man/man5/npm-json.5", "/Users/zkat/Documents/code/npm/man/man5/npm-package-locks.5", "/Users/zkat/Documents/code/npm/man/man5/npm-shrinkwrap.json.5", "/Users/zkat/Documents/code/npm/man/man5/npmrc.5", "/Users/zkat/Documents/code/npm/man/man5/package-lock.json.5", "/Users/zkat/Documents/code/npm/man/man5/package.json.5", "/Users/zkat/Documents/code/npm/man/man7/npm-coding-style.7", "/Users/zkat/Documents/code/npm/man/man7/npm-config.7", "/Users/zkat/Documents/code/npm/man/man7/npm-developers.7", "/Users/zkat/Documents/code/npm/man/man7/npm-disputes.7", "/Users/zkat/Documents/code/npm/man/man7/npm-index.7", "/Users/zkat/Documents/code/npm/man/man7/npm-orgs.7", "/Users/zkat/Documents/code/npm/man/man7/npm-registry.7", "/Users/zkat/Documents/code/npm/man/man7/npm-scope.7", "/Users/zkat/Documents/code/npm/man/man7/npm-scripts.7", "/Users/zkat/Documents/code/npm/man/man7/removing-npm.7", "/Users/zkat/Documents/code/npm/man/man7/semver.7" ], "gitHead": "75b462c19ea16ef0d7f943f94ff4d255695a5c0d", "_id": "[email protected]", "_npmVersion": "5.3.0", "_nodeVersion": "8.1.2", "_npmUser": { "name": "zkat", "email": "[email protected]" }, "dist": { "integrity": "sha512-ZJsOWVJ25E2C5Qedf4w9ePIv5hrPCdDIsHhq89tRxSJCqyIfDAMh0KoU9xeTu7yHT9ZrxPF7mopq1TCWxtMfkw==", "shasum": "e2ae85ef09d53f7f570a05578692899bf7879f17", "tarball": "https://registry.npmjs.org/npm/-/npm-5.3.0.tgz" }, "maintainers": [ { "email": "[email protected]", "name": "ceejbot" }, { "email": "[email protected]", "name": "zkat" }, { "email": "[email protected]", "name": "iarna" }, { "email": "[email protected]", "name": "isaacs" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/npm-5.3.0.tgz_1500009133941_0.17611657408997416" } }
這個(gè)會(huì)比較大,看一個(gè)簡(jiǎn)單的縮影:
{ "name": "algorithms-combined-js", "version": "1.0.1", "description": "algorithms for combined", "main": "libs/index.js", "scripts": { "build":"babel src -d libs", "prepublish":"npm run build", "test": "echo "Error: no test specified" && exit 1" }, "repository": { "type": "git", "url": "git+https://github.com/rawbin-/algorithms-combined-js.git" }, "keywords": [ "algorithms", "javascript", "combination", "arrangement" ], "author": "rawbin-", "license": "ISC", "bugs": { "url": "https://github.com/rawbin-/algorithms-combined-js/issues" }, "homepage": "https://github.com/rawbin-/algorithms-combined-js#readme", "devDependencies": { "babel-cli": "^6.18.0", "babel-preset-es2015": "^6.18.0", "babel-preset-stage-0": "^6.16.0" }, "dependencies": { "underscore": "^1.8.3" } }版本
作為包管理工具,最為重要的就是版本管理,版本管理主要在package.json里面體現(xiàn)在一下幾種書寫方式:
使用> >= < <= = 和 ||來組合具體范圍 1.2.7 || >=1.2.9 <2.0.0
使用-來指定范圍 1.2.3 - 2.3.4 等于 >=1.2.3 <=2.3.4
使用x X * 或者 留空 來指定版本通配 1.x 等于 >=1.0.0 <2.0.0
使用~來指定最鄰近右邊的大版本范圍,放開小版本的變更
~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
~1.2 := >=1.2.0 <1.(2+1).0 := >=1.2.0 <1.3.0 (Same as 1.2.x)
~1 := >=1.0.0 <(1+1).0.0 := >=1.0.0 <2.0.0 (Same as 1.x)
~0.2.3 := >=0.2.3 <0.(2+1).0 := >=0.2.3 <0.3.0
~0.2 := >=0.2.0 <0.(2+1).0 := >=0.2.0 <0.3.0 (Same as 0.2.x)
~0 := >=0.0.0 <(0+1).0.0 := >=0.0.0 <1.0.0 (Same as 0.x)
使用^來限定最左邊的大版本
^1.2.3 := >=1.2.3 <2.0.0
^0.2.3 := >=0.2.3 <0.3.0
^0.0.3 := >=0.0.3 <0.0.4
scripts 配置使用npm能運(yùn)行的腳本的命令,npm 允許在package.json文件里面,使用scripts字段定義腳本命令。這個(gè)字段的內(nèi)容比較豐富,也經(jīng)常用到:
prepublish publish postpublish
preinstall install postinstall
preuninstall uninstall postuninstall
preversion version postversion
pretest test posttest
prestop stop poststop
prestart start poststart
prerestart restart postrestart
任意命令的運(yùn)行方式為npm run scriptname,特殊的start stop restart test 可以直接用npm scriptname來運(yùn)行,
script部分可以參考看:http://www.ruanyifeng.com/blo...
常用命令npm i xxx -g === npm install xxx --global
npm i xxx -S === npm install xxx --save
npm i xxx -D === npm install xxx --save-dev
npm un xxx === npm uninstall xxx
npm ls /查看安裝的包
npm clean --force //強(qiáng)制清理安裝的包
npm publish xxx
npm unpublish xxx
設(shè)置源有的時(shí)候可能會(huì)出現(xiàn)安裝一些包的時(shí)候特別慢,所以需要設(shè)置一下國(guó)內(nèi)的源,最為通用的就是taobao的源,也可是使用其配置的npm別名cnpm,只不過是npm直接把源設(shè)置為國(guó)內(nèi)的淘寶源,使用方法:
//設(shè)置別名,注意區(qū)分自己的終端是bash還是zsh alias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc" # Or alias it in .bashrc or .zshrc $ echo " #alias for cnpm alias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc"" >> ~/.zshrc && source ~/.zshrc
臨時(shí)性的:
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry http://registry.cnpmjs.org
//配置指向源 npm config set registry https://registry.npm.taobao.org
永久性:
registry =https://registry.npm.taobao.org //寫入配置文件~/.npmrc
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/84121.html
摘要:博客地址這篇文章是我在眾成翻譯翻譯的一篇文章,一篇的入門指南,原文鏈接的出現(xiàn)使得用寫服務(wù)端應(yīng)用成為可能。你可以看到,這個(gè)過程也安裝了其他的模塊,它們都是的所依賴的模塊。但是,得到的輸出信息會(huì)很冗長(zhǎng),我們可以加上來精簡(jiǎn)一下輸出。 github 博客地址: https://github.com/zengxiaota... 這篇文章是我在 眾成翻譯 翻譯的一篇文章,一篇 npm 的入門指南,...
摘要:什么是讀音,類似于是一套用于構(gòu)建用戶界面的漸進(jìn)式框架。的核心庫(kù)只關(guān)注視圖層,不僅易于上手,還便于與第三方庫(kù)或既有項(xiàng)目整合。 什么是vue.js Vue (讀音 /vju?/,類似于 view) 是一套用于構(gòu)建用戶界面的漸進(jìn)式框架。與其它大型框架不同的是,Vue 被設(shè)計(jì)為可以自底向上逐層應(yīng)用。Vue 的核心庫(kù)只關(guān)注視圖層,不僅易于上手,還便于與第三方庫(kù)或既有項(xiàng)目整合。另一方面,當(dāng)與現(xiàn)代化...
摘要:從到完美,寫一個(gè)庫(kù)庫(kù)前端組件庫(kù)之前講了很多關(guān)于項(xiàng)目工程化前端架構(gòu)前端構(gòu)建等方面的技術(shù),這次說說怎么寫一個(gè)完美的第三方庫(kù)。使用導(dǎo)出模塊,就可以在使用這個(gè)庫(kù)的項(xiàng)目中構(gòu)建時(shí)使用功能。 從 1 到完美,寫一個(gè) js 庫(kù)、node 庫(kù)、前端組件庫(kù) 之前講了很多關(guān)于項(xiàng)目工程化、前端架構(gòu)、前端構(gòu)建等方面的技術(shù),這次說說怎么寫一個(gè)完美的第三方庫(kù)。 1. 選擇合適的規(guī)范來寫代碼 js 模塊化的發(fā)展大致有...
摘要:從到完美,寫一個(gè)庫(kù)庫(kù)前端組件庫(kù)之前講了很多關(guān)于項(xiàng)目工程化前端架構(gòu)前端構(gòu)建等方面的技術(shù),這次說說怎么寫一個(gè)完美的第三方庫(kù)。使用導(dǎo)出模塊,就可以在使用這個(gè)庫(kù)的項(xiàng)目中構(gòu)建時(shí)使用功能。 從 1 到完美,寫一個(gè) js 庫(kù)、node 庫(kù)、前端組件庫(kù) 之前講了很多關(guān)于項(xiàng)目工程化、前端架構(gòu)、前端構(gòu)建等方面的技術(shù),這次說說怎么寫一個(gè)完美的第三方庫(kù)。 1. 選擇合適的規(guī)范來寫代碼 js 模塊化的發(fā)展大致有...
摘要:的官方下載地址點(diǎn)我進(jìn)入的官方下載地址下載電腦系統(tǒng)對(duì)應(yīng)文件,然后進(jìn)行安裝,安裝成功之后通過命令行工具進(jìn)入安裝目錄。注系統(tǒng)命令行工具通過開始菜單輸入打開,系統(tǒng)為終端。 showImg(https://segmentfault.com/img/bVPL6q?w=200&h=200); Vue — 漸進(jìn)式 JavaScript 框架 介紹 Vue.js 是什么 vue.js 是一套構(gòu)建用戶界面...
摘要:的官方下載地址點(diǎn)我進(jìn)入的官方下載地址下載電腦系統(tǒng)對(duì)應(yīng)文件,然后進(jìn)行安裝,安裝成功之后通過命令行工具進(jìn)入安裝目錄。注系統(tǒng)命令行工具通過開始菜單輸入打開,系統(tǒng)為終端。 showImg(https://segmentfault.com/img/bVPL6q?w=200&h=200); Vue — 漸進(jìn)式 JavaScript 框架 介紹 Vue.js 是什么 vue.js 是一套構(gòu)建用戶界面...
閱讀 1514·2021-10-11 10:59
閱讀 1887·2021-09-09 11:36
閱讀 1402·2019-08-30 15:55
閱讀 1332·2019-08-29 11:20
閱讀 3067·2019-08-26 13:39
閱讀 1472·2019-08-26 13:37
閱讀 1966·2019-08-26 12:11
閱讀 1328·2019-08-23 14:28