Ethan
Ethan

Reputation: 3798

NPM install not working - one of the dependencies is missing

Whenever I try to execute npm install or npm i, I get this error:

npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'json-parse-helpfulerror'

I cannot update NPM through npm install npm -g or npm i npm -g, becuase it produces the same error. My computer was very low on space, and I have a feeling it might have deleted one of NPM's dependenices. The actual npm command works though.

Is there any way to fix this?

Upvotes: 1

Views: 364

Answers (1)

Sawant Sharma
Sawant Sharma

Reputation: 758

Reinstalling npm will fix the issue.

curl -L https://www.npmjs.org/install.sh | sh

If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer.

You can also try clearing the cache

npm cache clean

Upvotes: 1

Related Questions