Hello 👋

This is Hamid Afghan a software developer, Building web and mobile applications with Laravel, JavaScript and Node JS. Here, I try to share everything about the technologies I work with and the life experiences. Check the list of articles or the recent posts below.

Blog

Tutorial

Life

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.