aug aug - 1 year ago 468
Node.js Question

How to undo npm update?

Is there a way to undo the command

npm update
? I ran the command and now I have a bunch of unmet dependencies and some errors.

I'm trying to manually reinstall and fix all the errors but does anyone know how to essentially revert an
npm update

Answer Source

You can restore your package.json file to its previous state (hopefully you still have that, or at least remember what you had changed), and then do another npm update.


However, in general, this technique does not guarantee that your entire dependency tree will be restored to its exact former state (since the package.json files in a dependency tree often loosely specify dependency versions).

If you need to ensure that your package's dependency tree can be restored exactly, you have to use something like npm shrinkwrap to "lock down" the dependency versions (before you publish the package).

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