Languages

Node.js - what is --save option in npm install command?

0 points
Asked by:
Laylah-Walsh
654

What is the --save option in npm install command?

npm install --save

I was using just npm install all the time but recently I saw this on the internet and I don't know what it stands for.

1 answer
0 points
Answered by:
Laylah-Walsh
654

In older versions of npm (before npm 5.0.0) packages were installed under node_modules by default. You had to install dependencies first and then add them into dependencies section of your package.json.

Back then, the --save option was used to include the package into dependencies section of your package.json automatically.

Note:
Additionally, --save was used to save the package under devDependencies (--save-dev) or optionalDependencies (--save-optional).

0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join