Is npm install the same as npm install --save?

Peter Kellner picture Peter Kellner · Feb 19, 2016 · Viewed 13.1k times · Source

I'm looking at the doc page for node and I'm not clear if

npm install gulp-util

is the same as

npm install gulp-util --save

In the doc it says:

"By default, npm install will install all modules listed as dependencies in package.json"

That feels like what --save does,

https://docs.npmjs.com/cli/install

Answer

mikefrey picture mikefrey · Feb 19, 2016

Just running npm install with no arguments, will install everything listed in the dependencies area of the package.json file.

Running npm install <package-name> will install that package only, and will not add the package to the dependencies list in package.json

Running npm install <package-name> --save will install that package only, and will add the package to the dependencies list.

Update for npm 5+:

Running npm install <package-name> will install that package, and will add the package to the dependencies list.