Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm not working after clearing cache

Tags:

node.js

npm

People also ask

What happens if you delete npm cache?

Clearing the cache will let you install the packages from npm again and have a fresh start.

Why npm install is not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

Does npm have a cache?

The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents.

What is npm cache folder?

npm/_cacache folder by default. By utilizing a cache, npm will not download the same package from the internet and would extract the . tar file from your cache to your current working directory instead. With cached files, npm will optimize the number of downloads and internet usage for you.


This worked for me:

npm cache clean --force 

It should be

npm cache clean  

See https://docs.npmjs.com/cli/cache.html


"As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use

npm cache verify

instead."


try this one npm cache clean --force after that run npm cache verify