Fix Not Found Package Errors with .staging Warnings on Npm Install

Posted by in Software

TL;DR: Clean the npm cache and the package-lock.json

The other day I started to get ENOENT warning when running npm install like:

only to have the compilation failing with something like:

I’ve looked into it and the conclusion was that the error occurred because I’ve updated my node/npm version. Most answers recommend removing the npm cache either via rm -rf or via npm cache clean. however, this didn’t fix my problem. This issue seemed to match my behavious and one of the solutions was to remove package-lock.json and regenerate it with npm install.

Now, my problem is fixed and I can run yet again npm install without failing.

Note: I’ve tested it on both linux and windows and it worked.


A little experiment: If you find this post and ad below useful, please check the ad out :-)