Including of the word --save means? or What is the Difference betweeen:
npm install and npm install --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. 0 onwards. Before npm 5.0. 0, it was necessary to add --save after package name because it will save the installed package to package.
--save saves the name and version of the package being installed in the dependency object. --save-dev saves the name and version of the package being installed in the dev-dependency object.
There is no noticable difference between --save and --save-dev when developing. To take the moment. js example: when running webpack, the moment code is taken from node_modules and included in the project. In this sense there is no difference with typescript which is also needed when running webpack.
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.
Base on the npm documentations:
For older versions of NPM:
The npm install <package_name>
command just downloads the specified package from NPM cloud, and saves it in node_modules
directory in your current directory.
The npm install <package_name> --save
command downloads the specified package from NPM cloud, and saves it in node_modules
directory in your current directory, and also it adds the installed package into dependencies
section of your package.json
file.
For NPM versions > 5, there is no difference between these two commands. That is, the first command without --save option downloads the package and adds it into dependencies section of package.json
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With