Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

difference between npm --save-dev & npm --save


The difference between --save and --save-dev may not be immediately noticeable if you have tried them both on your own projects.
So here are a few examples... Let's say you were building an app that used the moment package to parse and display dates.
Your app is a scheduler so it really needs this package to run, as in: cannot run without it.

In this case you would use

npm install moment --save


This would create a new value in your package.json

"dependencies": {
    ...
    "moment": "^2.17.1"
}

When you are developing, it really helps to use tools such as test suites and may need jasmine-core and karma. In this case you would use

npm install jasmine-core --save-dev
npm install karma --save-dev


This would also create a new value in your package.json

"devDependencies": {
    ...
    "jasmine-core": "^2.5.2",
    "karma": "^1.4.1",
}



Original Answer


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.