[Reserved] npm install, install --save and npm install --save-dev difference npm

npm install X:

  • X will node_modules package to the directory
  • Does not modify package.json
  • When you run npm install command after, it does not automatically install X

npm install X –save:

  • X will node_modules package to the directory
  • X will be added in the dependencies of property package.json
  • When you run npm install command after X automatically installed to node_modules directory
  • After running npm install -production or variable value is specified NODE_ENV production, to automatically install msbuild directory node_modules

npm install X –save-dev:

  • X will node_modules package to the directory
  • X will be added in devDependencies property of package.json
  • When you run npm install command after X automatically installed to node_modules directory
  • After running npm install -production or variable value is specified NODE_ENV production, X is not automatically installed into the directory node_modules

Guess you like

Origin www.cnblogs.com/WX1211/p/11613049.html