What does the --save option do when using npm install?

looper003 asked this question 1 year, 5 months ago
looper003 on Dec 13, 2021

I've seen the npm install --save command used in several different places, but can't figure out what the --save option does.

2 suggested answers
coderguy on Dec 22, 2021

The --save or -S flag adds the package to the "dependencies" list in your package.json file.

The "dependencies" list contains all the packages needed to run your application.

0 replies
itsbambi on Dec 22, 2021

It tells NPM to install to the "dependencies" list in the package.json file.

As of NPM version 5, packages are installed to "dependencies" by default. Therefore, the --save flag is no longer needed. There are still other save options that are listed in the NPM documentation.

0 replies