Vincent
Vincent

Reputation: 6188

How do I update npm in linux?

enter image description here

I've tried the following in order to update npm. But no commands seem to work. What should I do so I can update npm?

Upvotes: 0

Views: 446

Answers (1)

Paul Mougel
Paul Mougel

Reputation: 17048

The npm update command updates all packages (no arguments), a specific package (with a package name as argument); in the local directory or in the global modules directory (-g argument).

As stated in the npm documentation, sometimes the npm update npm -g command doesn't work, especially if you run an old version of npm, which you are. To really update npm, run this:

$ curl https://npmjs.org/install.sh | sh

Upvotes: 2

Related Questions