

This will be ~/.npm on Posix, or %AppData%/npm-cache on Windows, according to the npm documentation.

When you install npm packages on your computer, npm will first add the packages and dependencies in your local npm cache folder. This will force delete the npm cache on your computer. Npm cache clean -force or npm cache clean -f. are both not working and you still can’t clear the cache, you can force clear the cache by running: Run: “npm cache clean –force”Īnd if npm cache clean and npm cache verify. If that doesn’t solve your problem, you can also try deleting the node_modules folder in your project and re-running npm install. So if you get that error, try running npm cache verify. Npm ERR! If you're sure you want to delete the entire cache, rerun this command with -force. If you want to make sure everything is consistent, use 'npm cache verify' instead.

However if you’re running npm v5 and above, npm is supposed to be self-healing, and you may get the following error message when trying to clean the npm cache: npm ERR! As of, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. Run: “npm cache verify” for npm version 5 and up To fix this, you can try running npm cache clean. If you ever get weird errors in npm like Please run npm cache clean you may need to clean or refresh your npm cache.
