-
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 creates its cache directory in my $HOME #1451
Comments
Oh, there's an implementation for nodejs! |
Not a duplicate. This bug is about the default behaviour being broken (i.e.: placing cache outside of where all application's cache should be). #1305 is about the behaviour when overriding the default also being broken. |
npm is one of the few programs which keeps littering my $HOME. Annoying. |
tl;dr: If you are seeing this when running I've been digging into this issue (or rather, this issue) for some time now. In my case, a package was downloading an additional binary to the directory specified by Given the {
"scripts": {
"install": "node --eval 'console.log(process.env.node_config_cache)'"
}
} Running the following:
That lead me to discover this regression. After upgrading to the latest version of |
What's the holdup on this? Should be an easy fix to change and prefer a different directory imo. |
npm If your bug is reproducible 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. |
Discussion on this issue has now moved here: npm/rfcs#389 |
What / Why
npm
keeps creating its cache directory in my$HOME
. I keep very few directories in my$HOME
to keep things findable, and its very annoying when apps start littering stuff there.When
Any time I run things like
npm install blah
.Where
How
Current Behavior
A directory is creted in
$HOME
and cache data stored in there.Steps to Reproduce
rm -rf .cache
to delete your existing cache.package.json
.npm install
.Expected Behavior
The cache directory should be in
$XDG_CACHE_HOME
on Linux. Specifically, it should be$XDG_CACHE_HOME/npm
.$XDG_CACHE_HOME
should default to.cache
if undefined.I believe on macOS there's a different spec for default locations, and things like cache are stored in a different place. I don't know the name of the spec so can't easily link in here.
Who
References
XDG Base Directory Specification
The text was updated successfully, but these errors were encountered: