39

I'm seeing this command on some packages and I wonder what the -s argument means, for example

npm i -S classnames flexboxgrid

I mean, I know that, just like i is an abbreviation of install, it is an abbreviation of something, however I tried looking at npm help, npm help help, npm apihelp npm, npm help npm, nothing practically helpful there. This is like giving a dictionary to an illiterate; many words, but nothing about option arguments or their abbreviations.

Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
  • 4
    Possibly helpful: https://docs.npmjs.com/misc/config – piedar Nov 29 '16 at 14:36
  • @piedar thanks. `--save`. Right. – Yanick Rochon Nov 29 '16 at 14:38
  • 1
    Downvotes should require comments. It makes no sense to disapprove something without specifying why. – Yanick Rochon Nov 29 '16 at 16:50
  • 7
    Can I politely point out that this isn't a duplicate, at least not of the cited question? The OP is asking what -S stands for, not what save means. I similarly had seen an abbreviated npm option and couldn't find the npm docs on the abbreviations. @piedar's comment told me and should be an accepted answer. – Rich N Apr 27 '18 at 14:40

1 Answers1

34

The 'S' option is the Save option in npm. It adds the npm package to your dependencies for your project. You can also add the dependency manually by editing the package.json file.

To answer your question about getting help for npm, use the following command:

npm help i

That will give you a description of all the options available for the 'i' option.

bougiefever
  • 1,147
  • 10
  • 11
  • Just to point out that, `npm help S` (which was the option I was wondering about) is not displaying the same as `npm help i`; the former does *not* work. – Yanick Rochon Nov 29 '16 at 14:51
  • Yes, he needs to use "npm help i". But otherwise, this answer is wrong in many ways: "npm help i" does not give help for the "i" option. It gives help for the "i" command. "-S" or "--s" (not S) are not NPM options. They are options of the "i" or install command. – John Pankowicz Oct 28 '17 at 16:25
  • 24
    `-S` has been removed; `npm i` has been replaced by `npm i --no-save`. – Knu Jun 11 '18 at 11:56
  • This is also handy: npm i -D for npm install --save-dev – Ansjovis86 Jun 21 '19 at 10:38