sbaaaang sbaaaang - 1 year ago 129
Javascript Question

Npm - update and save both deps and depsDev in 1 command line?

I want to update multiple npm dependecies and save them to the respective package.json dependency slot.

My package.json:

"dependencies": {
"gulp": "^3.0.0"
"devDependencies": {
"gulp-eslint": "^2.8.0"

So i want to run:

$ npm update gulp gulp-eslint

That's ok but how to save the newer versions both for gulp (dep) and gulp-eslint (devDep) respectively ?

I tried:

$ npm update gulp gulp-eslint --save

but gulp-eslint is devDependency actually must be saved there, how to do all this in 1 command line?

Answer Source

You can check the official documentation for npm-update and notice that there are different specifications according to the npm version you are using.

From the command line you can do:

$ npm update --save --dev

Note: Use sudo if your are on Linux or Mac.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download