npm config list
Show install location of Node
Install the dependencies in the local node_modules folder. By default, npm install will install all modules listed as dependencies in package.json.
npm install [-npm-module]
npm install cows
Package will be installed locally
npm install -g [-npm-module]
npm install -g cows
Package will be installed globally
global packaged typically installed in
npm install –save-prod
npm install cows --save-prod
Package will appear in your package.config > dependencies
Good for production js files (e.g. jquery, angular, react…)
NOTE: As of npm v5, anything installed with
npm install, even without the
--save-prod flag, will be added to the dependencies in the
npm install –save-dev
npm install cows --save-dev
Package will appear in your package.config > devDependencies
Good for development environment tools (e.g. webpack, sass, selenium-webdriver)
This runs an arbitrary command specified in the package’s “start” property of its “scripts” object. If no “start” property is specified on the “scripts” object, it will run node server.js.
This is the plumbing command called by npm link and npm install.
This runs a package’s “test” script, if one was provided.
npm run [-script]
Shortcut for a custom npm run-script runs an arbitrary command from a package’s “scripts” object. If no “command” is provided, it will list the available scripts.