In the past --save
was used to add the package to the package.json
, but as of NPM 5 installing adds packages by default: What is the --save option for npm install?. So does save do anything in NPM 5.0 +?
Asked
Active
Viewed 333 times
0

ICW
- 4,875
- 5
- 27
- 33
-
1Did you read the accepted answer there? *"As of npm 5.0.0, ... the `--save` option is no longer needed."* It still does the same thing, but that's now just confirming what's already the default. – jonrsharpe Jan 19 '21 at 20:33
-
@jonrsharpe It says it is "no longer needed", that doesn't mean that it doesn't do anything. I'm wondering if it has any effect at all, and the answers in that post don't explicitly say that `--save` does nothing. – ICW Jan 20 '21 at 14:43
-
I suppose it depends what you mean by *"do anything"*. `--save` and `--no-save` set the save option to true and false respectively, so it does *something*. But the default is now already true, so that something has become pointless. – jonrsharpe Jan 20 '21 at 14:55
1 Answers
2
Is not necessary any more. It does not even appear in the npm documentation. But I think they leave the option to use if for back compatibility

Santiago Mendoza Ramirez
- 1,497
- 2
- 13
- 26