While in the process of updating an Angular app I and colleagues are working on, I ended up running "npm update" when I meant to run "npm install". Doing so led me on a bit of a rabbit trail because of course now all my dependencies - AND their dependencies got updated in the process. From there I had to resolve certain conflicts to get the new versions to work correctly. However, this also led me to a point where a bug in one of those dependencies is preventing my app from booting up. According to the the Angular github repo, the issue is being worked on.
My question is, how can I revert to my previous setup in the meantime? I tried copy and pasting the package.json file as it originally existed before my "npm update", deleting my "node modules" folder, and running "npm install" again. But this doesn't resolve the issue. Is there a way I can be assured of reverting to my previous working setup?
The process you described should work:
package.json
from your repository at the state you know it workedrm -rf node_modules
to remove the node_modules
foldernpm install
to install againIf that didn't work, verify that you:
package.json
and node_modules
)node_modules
folder (chmod 777 node_modules
)package.json
that is written in the file system is actually the restored one (sometimes an IDE or Git can create a weird shadow copy where you think it's one way, but it's really another). You can tell this by using cat package.json
and inspecting the output