-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npm cache clean --force does not clean cacache files #1785
Comments
Hello! Facing the same issue in windows too... npm version - 5.6.0 Getting the error - Could you prioritize, please...Unable to install node modules for any of the new projects If there is any other way to get rid of that error, please help (Have tried npm cache clean/clear --force, Couldn't delete the npm-cache files manually, even tried deleting individually) Thank you |
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
I have the same issue, did you get a fix? |
Confirmed fixed in npm |
Hi! I was looking into a bug with very similar behavior as https://npm.community/t/using-npm-ci-does-not-run-prepare-script-for-git-modules/632. It suggested one of the sources of the issue could be a stale cache, so I tried running
npm cache clean --force
. After digging around the source code, I discovered this does not, in fact, clean caches.Current Behavior:
Running
npm cache clean --force
does not remove the files in~/.npm/index-v5
, which appears to be where the files fromcacache
end up: https://github.com/npm/cacache/blob/1e5d25448f39194f1217047e08613fd726766911/lib/entry-index.js#L249-L251.As far as I can tell,
npm cache clean
will delete the~/.npm/_cacache
directory, which doesn't exist for me:cli/lib/cache.js
Lines 65 to 76 in bd2721d
Expected Behavior:
npm cache clean --force
removes all local cache, including those currently contained in~/.npm/index-v5
.Steps To Reproduce:
Run
npm cache clean --force
.~/.npm/index-v5
should be empty or removed, but it isn't.More importantly, after running
npm cache clean --force
, no package fetching should be getting cache hits.More details
I figured this out by digging through a bunch of npm source code. In particular, I added logging to pacote to show that it was hitting the cache even after I ran
npm cache clean --force
.Environment:
The text was updated successfully, but these errors were encountered: