202

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

simplesthing
  • 2,506
  • 3
  • 13
  • 16

3 Answers3

239

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.

Hanuman
  • 6,771
  • 3
  • 41
  • 39
sagunms
  • 7,354
  • 5
  • 39
  • 42
27

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

Arian Acosta
  • 5,645
  • 1
  • 30
  • 30
Joniras
  • 1,079
  • 9
  • 30
-9

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

For example: npm i -D package-name

oabarca
  • 10,186
  • 6
  • 56
  • 69