I understand the differences between npm install something
and npm install something --save
(for anyone wondering, the first one will install the dependency only while the latter will install the dependency and add it to your package.json).
However I do not understand why there is a --save
option in the first place. In other words, why would you ever want to install a dependency without adding it to your package.json file? Why is the --save option not default?
A lot of websites/npm modules/SaaS suggest installing their module using npm install something
(newrelic is one of them for instance), am I missing something?
Edit: Starting from NPM 5, --save
is now on by default.