Downgrade npm to an older version

Don Kirkby picture Don Kirkby · Sep 26, 2017 · Viewed 152.5k times · Source

I tried updating npm to see if it would solve some dependency problems we were having, and now I want to downgrade to the version the rest of the development team is using. How can I install an older version?

I updated npm according to the instructions on the installation page:

Updating npm

Node comes with npm installed so you should have a version of npm. However, npm gets updated more frequently than Node does, so you'll want to make sure it's the latest version.

npm install npm@latest -g

Answer

Don Kirkby picture Don Kirkby · Sep 26, 2017

Just replace @latest with the version number you want to downgrade to. I wanted to downgrade to version 3.10.10, so I used this command:

npm install -g [email protected]

If you're not sure which version you should use, look at the version history. For example, you can see that 3.10.10 is the latest version of npm 3.