npm install package command
1, a partial installation
npm install <package_name>
Installation instructions to the current project
After this command is equivalent to npm 5x npm install --save <package_name> also be written to the same dependency dependencies
2, the overall installation -g
npm install -g <package_name>
To install and does not reflect the overall situation inside package.json
3, mounted to the production dependent --save
npm install <package_name> --save | -S
Installation to the current project, and write the package information to the dependencies
4, mounted to the development of dependency --save-dev
npm install <package_name> --save-dev | -D
Attached to the current project and write to devDependencies
devDependencies and dependencies of the differences:
devDependencies is a dependency of the local development
dependencies is a dependency of the production environment
Installation dependencies
npm install
All packages will be under will package.json inside devDependencies and dependencies to the project node_modules download folder (no change will create a new folder)
Install only dependent on production
npm install --production