How to use the -S option when using npm to install packages
Published on Aug. 22, 2023, 12:13 p.m.
Some people use the – save option when installing packages with npm.What does the – save option do?
npm install packagename --save
Npm is a package manager for node.
When you download a package using the npm command, it installs the packages in the node_modules folder and adds the installed module as a dependency in your package.json file.
Npm installed the packages in node _modules before the 5.0.0, but didn’t make them a dependency by default.
If you wanted to save the module as a dependency in the package.json file, you had to do it using the – save or -S option .
As of version 5.0.0, you no longer need to use this option.