I am about to install this npm package and it says npm install -D load-grunt-config
. What does the -D
flag do?
2 Answers
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.
-
62
-
-
3For me, the -D flag will not update package.json, forcing me to use --save-dev instead. Crazy as usual :( Commented Oct 27, 2017 at 14:44
-
1
-
5
As described in the NPM Install Docs:
-D,
--save-dev
: Package will appear in yourdevDependencies.
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
-
2Adding to this, the equivalent using yarn is
yarn add <package...> [--dev/-D]
Commented Aug 22, 2019 at 15:30
-D
is different from-d
.