what does npm -D flag mean?

Npm

Npm Problem Overview


I am about to install this npm package and it says npm install -D load-grunt-config, what does the -D flag do?

Npm Solutions


Solution 1 - Npm

The -D flag is the shortcut for: --save-dev. Source: https://docs.npmjs.com/cli/install

> -D, --save-dev: Package will appear in your devDependencies.

Solution 2 - Npm

As described in the NPM Install Docs:

> -D, --save-dev: Package will appear in your devDependencies.

Which means that the package will not be installed if you do npm install --production.

A detailed explanation of the different types of dependencies: SO-Answer

Solution 3 - Npm

Flag -D is often used along with i which stands for "install"

For example: npm i -D package-name

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsimplesthingView Question on Stackoverflow
Solution 1 - NpmsagunmsView Answer on Stackoverflow
Solution 2 - NpmJonirasView Answer on Stackoverflow
Solution 3 - NpmoabarcaView Answer on Stackoverflow