本文翻译自:npm install vs. update - what's the difference?
What is the practical difference between npm install
and npm update
? npm install
和npm update
之间有什么实际区别? When should I use which? 我什么时候应该使用哪个?
#1楼
参考:https://stackoom.com/question/qMH1/npm-install-vs-update-有什么区别
#2楼
npm install installs all modules that are listed on package.json
file and their dependencies. npm install安装package.json
文件及其依赖项中列出的所有模块。
npm update updates all packages in the node_modules
directory and their dependencies. npm update更新node_modules
目录中的所有包及其依赖项。
npm install express installs only the express module and its dependencies. npm install express只安装express模块及其依赖项。
npm update express updates express module (starting with npm@2.x, it doesn't update its dependencies). npm update express updates express模块(从npm@2.x开始,它不会更新其依赖项)。
So updates are for when you already have the module and wish to get t