Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between 'npm add' and 'npm install --save'?

I've searched through the web and still can't get if there is any difference between npm add <package> and npm install --save <package>.

Thanks.

like image 394
theVoogie Avatar asked Jul 22 '18 15:07

theVoogie


People also ask

What is difference between npm install and npm install -- save?

It has a very frequently used command npm install [Package Name] –save. But the fact is there is no difference between npm install [Package Name] and npm install [Package Name] –save in the later version after npm 5.0.

What does -- save do when npm install?

--save. NPM provides the --save option while installing the packages. If we use the --save option after installing the package, it will be saved in package. json inside dependencies.

What is the difference between npm and install?

There is no difference, since "npm i" is an alias for "npm install". They both do the exact same thing (install or update all the dependencies in your package-lock.

Is npm Install -- Save necessary?

As of npm 5.0. 0, installed modules are added as a dependency by default, so the --save option is no longer needed.


1 Answers

npm install and add are aliases. The --save option is deprecated.

Since NPM 5, packages are saved automatically; there is no --save option.

like image 122
SamVK Avatar answered Sep 22 '22 18:09

SamVK