1. npm install
Local 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 -g
Global 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 msbuild
package to the node_modules
directory (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.json
dependencies
msbuild
npm install
msbuild
node_modules
npm install --production
NODE_ENV
production
msbuild
node_modules
4.npm install --save-dev
(1) will msbuild
package to the node_modules
directory (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.json
devDependencies
msbuild
npm install
msbuild
node_modules
npm install --production
NODE_ENV
production
msbuild
node_modules