node.js build command - Grunt.js: What does -save-dev mean in npm install grunt --save-dev
There are (at least) two types of package dependencies you can indicate in your package.json files:
Those packages that are required in order to use your module are listed under the "dependencies" property. Using npm you can add those dependencies to your package.json file this way:
npm install --save packageName
Those packages required in order to help develop your module are listed under the "devDependencies" property. These packages are not necessary for others to use the module, but if they want to help develop the module, these packages will be needed. Using npm you can add those devDependencies to your package.json file this way:
npm install --save-dev packageName
I've just started using Grunt.js. It is pretty hard to set up and I am at the point of creating a
Following this tutorial, it says there are 3 ways to create a
The first is to do
npm install grunt --save-dev
But what does
--save-dev means? I tried looking but it ends in vain.
Documentation from npm for
npm install <package-name> --save and
npm install <package-name> --save-dev can be found here:
package.json file declares metadata about the module you are developing. Both aforementioned commands modify this
--save will declare the installed package (in this case,
grunt) as a dependency for your module;
--save-dev will declare it as a dependency for development of your module.
Ask yourself: will the installed package be required for use of my module, or will it only be required for developing it?