NPM --save and --no-save

Jan 8, 2022

As a JavaScript developer, always you need to keep in your mind which is the right argument that should be added.

As of npm 5.0.0, installed modules are added as a dependency by default, so the --save option is no longer needed. The other save options still exist and are listed in the documentation for npm install.

npm install --save

When the above command is used with npm install this will save all your installed core packages into the dependency section in the package.json file. Core dependencies are those packages without which your application will not give desired results. But as mentioned earlier, it is an unnecessary feature in the npm 5.0.0 version onwards.

npm install --no-save

When this command is used with npm install it will not allow the installed packages from being saved into the dependency section. The package name won't be in the side `package.json` file.

There are more options as well. You can find them in the below link. NPM Documentation

The best.