102

I've seen some posts that refer to running npm with a -d argument. For example, this issue refers to doing npm -d install coffee-script. There are a few other pages that also refer to this syntax, including the install instructions for at least one npm package.

But I've been unable to find any documentation for this -d argument. The docs for npm install make no mention of -d, nor does the npm FAQ, nor do any of the other documentation pages I've looked through.

Does the -d option do anything? If so, what?

2
  • 2
    I think that should be "npm i -D .........." which would be equivalent of "npm install --save-dev ............"
    – DevWL
    Commented Jun 10, 2017 at 8:00
  • 3
    @DevWL, did you read the other answers to this question? :-) -d and -D are different. stackoverflow.com/a/28463702/87399
    – Joe White
    Commented Jun 10, 2017 at 19:32

1 Answer 1

93

It's a shortcut for --loglevel info

See the Shorthands and Other CLI Niceties section:

  • -d: --loglevel info
4
  • 98
    Ah... of course the command-line parameters wouldn't be documented on the pages that talk about command-line parameters or the commands they apply to. Silly me!
    – Joe White
    Commented Mar 3, 2012 at 15:07
  • 3
    @JoeWhite Ugh, was just tearing my hair out trying to figure out what it is. Google isn't exactly friendly to short command line options.
    – Alex B
    Commented Jun 26, 2013 at 3:02
  • Makes much more sense to be under "misc"... Just ask Google if they agree: google.com/search?q=npm+install+-d Commented Jan 7, 2014 at 10:52
  • 4
    What was debug then again? Ahh, turns out there is no --loglevel debug but "verbose" (-dd) and "silly" (-ddd). Fair enough.
    – Philzen
    Commented Apr 3, 2014 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.