📜  npm install 和 npm install save --dev - Shell-Bash 代码示例有什么区别

📅  最后修改于: 2022-03-11 14:49:54.193000             🧑  作者: Mango

代码示例1
npm install saves any specified packages into dependencies by default. Additionally, you can control where and how they get saved with some additional flags:

-P, --save-prod: Package will appear in your dependencies. This is the default unless -D or -O are present.

-D, --save-dev: Package will appear in your devDependencies.

-O, --save-optional: Package will appear in your optionalDependencies.

--no-save: Prevents saving to dependencies.

tl;dr: the default form of npm install if nothing else is specified is to --save it.