
Craig Curtis
19,985 PointsDifference between npm install something vs. npm install something --save vs. npm install something --save-dev
I've tried both --save and --save-dev npm installing, but in package.json, I only see something in dependencies rather than dev dependencies. So when do we use each of these?
- npm install something
- npm install something --save
- npm install something --save-dev
1 Answer

Chyno Deluxe
16,921 PointsHi Craig,
The differences between all three are as follow.
- will install the npm package to your node_modules folder and not be added to the package.json
- --save - package(s) required by the application to run
- --save-dev - package(s) required for development purpose.
Craig Curtis
19,985 PointsCraig Curtis
19,985 PointsOk it makes sense. I was just having an error that threw me off -- my index.html wasn't being updated with --save for some reason the first time. Thank you!
gerardo keys
14,289 Pointsgerardo keys
14,289 PointsI don't think this is correct any longer. The latest version of npm allows you to do npm install <package> and it does show up in package.json, without needing --save. You may need to update your comment.