I\'ve been desperately trying to install modules using node.js but it always fails getting packages with npm.
I logged in as Administrator and used powershell/cmd wi
Deleting the global npm-cache and/or running my cmd line as admin did not work for me. Also, as of npm version 5.x.x, it supposedly recovers from cache corruption by itself.
This did work:
1. Deleted the node_modules folder in my current project.
2. Deleted the package-lock.json in my current project
3. Installed the new package. In my case: npm install bootstrap@next --save
4. Ran npm install for my current project.
Everything now works. In general, nuking node_modules and package-lock.json usually fix these "no apparent reason" bugs for me.
I just had the same problem again. But I noticed that everything was installed correctly even though it threw the error after I had followed the steps outlined above. So I could just run ng serve (for Angular), and everything worked.
This sure is a weird error...