The difference between npm's --save and --save-Dev

When executing the npm package manager installation package, there will be two installation methods, one is –save and the other is –save-dev

Common ground

1. Both methods will be installed in the node_modules directory.
2. Both methods will be saved in package.json.

the difference:

In the package.json file, there are two objects that store modules.
--Save is a declaration of the dependencies required for the production environment (framework and libraries used in the development of applications), such as: jq, react, and vue all need to be placed here.
--Save-Dev is the declaration of the dependencies required for the development environment (build tools, test tools),
such as: babel, webpack, all placed in the current directory

How to judge:

One is that when you use the current module, the current module will tell you on github which way it needs to be installed.
The other is to judge by your own needs

Guess you like

Origin blog.csdn.net/weixin_43902063/article/details/113172656