Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore deleted 'node_modules' folder?

Tags:

npm

On Ubuntu 16.04 I accidently deleted the 'node_modules' folder so that I can't run npm anymore. I get the error:

bash: /usr/local/bin/npm: No such file or directory.

How can I fix this?

like image 425
mrfr Avatar asked Jul 15 '26 17:07

mrfr


1 Answers

If package.json is present in your project directory, which usually is, then run npm install and all the packages will be restored as well as the node_modules directory, where they are stored.

like image 132
its4zahoor Avatar answered Jul 18 '26 04:07

its4zahoor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!