I have recently come across one of these statements in a node project that I am currently working on that we use to install node modules locally
npm install -d --save
Can somebody please tell me what it means as earlier we used to use simply npm install
I want to know the difference between the two
From http://npmjs.org/doc/misc/npm-config.html:
The following shorthands are parsed on the command-line: -d: --loglevel info
From https://www.npmjs.org/doc/install.html
--save: Package will appear in your dependencies.
It adds it to your dependencies in your packages.json
For example, I just did
npm install async --save
It added this to my packages.json
"dependencies": {
"async": "~0.2.10",
Before you do that however, make sure you create your packages.json by running
npm init
By adding packages to source control (but not the node_modules it lays down locally), when others consume your solution, when they do 'npm install' after pulling your solution, it will pull those dependencies - you don't have to distribute.
https://www.npmjs.org/doc/cli/npm-install.html
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