Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM update all to latest version [duplicate]

Tags:

node.js

npm

I want to update all my packages to the latest version:

npm outdated

Result:

Package                Current        Wanted        Latest  Location
cordova            3.4.0-0.1.0  3.6.3-0.2.13  3.6.3-0.2.13  cordova
commander                2.0.0         2.0.0         2.3.0  npm-check-updates > commander
async                   0.2.10        0.2.10         0.9.0  npm-check-updates > async
semver                   2.2.1         2.2.1         4.0.3  npm-check-updates > semver
read-package-json        1.1.9         1.1.9         1.2.7  npm-check-updates > read-package-json
npm                     1.3.26        1.3.26         2.1.2  npm-check-updates > npm

How can I do that?

I tried it:

sudo npm update -g cordova

And this too with no errors:

npm install npm-check-updates

But it's not working.

Thanks!!

like image 497
chemitaxis Avatar asked Oct 09 '14 10:10

chemitaxis


People also ask

How do I update multiple npm packages?

If you still want to update everything to the latest version, you can use the tool npm-update-all . It's as easy as running this command in your project folder. As you can see, npm-update-all will update all your packages to the latest version.

Does npm install multiple versions of same package?

The good news is that you can have it done directly via NPM! What can be done in this case is an idea called "package alias". So you can have multiple versions of the same package running in your app and you can work on the upgrades mitigating possible issues.


1 Answers

npm can! For example, we will update cordova to the latest version:

sudo npm install -g cordova@latest

To update npm, just do the same:

sudo npm install -g npm@latest
like image 60
Laurent Avatar answered Sep 28 '22 08:09

Laurent