简体   繁体   English

'npm add'和'npm install --save'之间的区别?

[英]Difference between 'npm add' and 'npm install --save'?

I've searched through the web and still can't get if there is any difference between npm add <package> and npm install --save <package> . 我在网上搜索过,如果npm add <package>npm install --save <package>之间有任何区别,我仍然无法获取。

Thanks. 谢谢。

npm install and add are aliases. npm installadd是别名。 The --save option is deprecated. 不推荐使用--save选项。

Since NPM 5, packages are saved automatically; 自NPM 5起,包将自动保存; there is no --save option . 没有--save选项

add is just an alias for install . add只是install的别名。

So the only difference is --save , which modifies package.json with the dependancy. 所以唯一的区别是--save ,它使用依赖性修改package.json

 $ npm add --help npm install (with no args, in package dir) npm install [<@scope>/]<pkg> npm install [<@scope>/]<pkg>@<tag> npm install [<@scope>/]<pkg>@<version> npm install [<@scope>/]<pkg>@<version range> npm install <folder> npm install <tarball file> npm install <tarball url> npm install <git:// url> npm install <github username>/<github project> aliases: i, isntall, add common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM