Reputation: 1794
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?
Upvotes: 3
Views: 19825
Reputation: 1811
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.
Upvotes: 12
Reputation: 670
It looks like you deleted more than your node_modules
directory, if the npm
binary is missing. Just Reinstall Node.js/npm.
Upvotes: 3