Relations npm install -g and the npm install --save-dev

1. npm installLocal installation

(1) The mounting kit  (directory where npm run command), if it is not  a directory, will perform in the current  generation directory command  directory. (2) may  be introduced locally installed package. ./node_modules node_modules npm node_modules 
 require()

2. npm install -gGlobal Installation

(1) package will be installed on  or under your  installation directory. (2) can be used directly in the command line. /usr/local node 

3.npm install --save

(1) will msbuildpackage to the node_modulesdirectory (2) will be in the added attribute at run after (3) command, automatically installed into the directory run after (4) or specified variable value when automatically installed to directory 
package.jsondependenciesmsbuild 
npm installmsbuildnode_modules 
npm install --productionNODE_ENVproductionmsbuildnode_modules

4.npm install --save-dev

(1) will msbuildpackage to the node_modulesdirectory (2) will be in the added attribute at run after (3) command, automatically installed into the directory run after (4) or specified variable value , the automatic installation is not to catalog 
package.jsondevDependenciesmsbuild 
npm installmsbuildnode_modules 
npm install --productionNODE_ENVproductionmsbuildnode_modules

Guess you like

Origin www.cnblogs.com/du-jun/p/12458088.html