Home > Back-end >  How to restore a file that has been changed in node_modules?
How to restore a file that has been changed in node_modules?

Time:02-26

I changed a file in node_modules and can get back to default state. Then I delete this file. Are there any npm command that I can use to load this file? I used npm install, audit. Didn't help, if it was supposed to help at all.

CodePudding user response:

You can try deleting the node_modules folder and running.

npm install

To reinstall all the packages. This will reinstall all module codes and solve your code conflicts and changes. If you need to keep any other changes, You can copy those modules folders and replace them after you reinstall the node modules. And if you are a beginner, You can get a copy of the entire project folder and try using that to avoid any mistakes.

  • Related