I can\'t use npm install
using the command prompt in NodeJS. I\'m getting these errors when running npm install
:
module.js:339
On Arch Linux what did the trick for me was:
sudo pacman -Rs npm
sudo pacman -S npm
I had the same issue but it was caused by a broken package-lock.json
file.
Deleting package-lock.json
and running npm install
again fixed it for me.
For Mac users, I tried installing a bunch of new node versions and uninstalling different ones. That didn't fix it. You have to completely wipe out all your installations first. Follow these instructions... How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X).
Then download the latest version of node.
On MS Windows, the solution is to remove %APPDATA%\npm
and reinstall node
Actually, it is taking the reference of previously stored modules.
Solution:Delete the npm-cache/npm folder in the installation directory of nodejs. In windows, it is in C:/User/Username/Appdata/Roaming/npm(or npm_cache). and try to install again.
Same thing to do in any OS.
In my case, simply re-running brew install yarn
fixed the problem.