Skip to content
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] Extra .npm directory created in user's home while npm_config_cache set #3350

Open
1 task done
WhyNotHugo opened this issue Jun 2, 2021 · 5 comments
Open
1 task done
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@WhyNotHugo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

A ~/.npm directory gets created on npm install along with the correct directory specified in npm_config_cache. On a fresh install without a cache created yet, the size of the extra ~/.npm directory is 2.1 MiB and the size of the specified ~/.cache/npm directory is 89.1 MiB.

Expected Behavior

Obey the npm_config_cache without creating the extra directory in home.

Steps To Reproduce

npm install a package while having npm_config_cache set to a location other than default. The extra directory is created at the end of install.

Environment

Originally:

Arch Linux
node v14.2.0
npm 6.14.5

Ongoing:

Arch Linux
node v16.2.0
npm 7.15.1

@WhyNotHugo WhyNotHugo added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jun 2, 2021
@WhyNotHugo
Copy link
Author

I wish you'd ask reporters if an issue is still valid before closing, locking it, and requesting that a new one is opened.

It's a waste of everyone's time for someone to copy-paste the issue from the old ticket (#1305) to a new one.

Sadly, GitHub strips markdown when copy-pasting. See #1305 for a formatted version.

@ruyadorno
Copy link
Collaborator

Closing since the largest discussion already took place in npm/rfcs#389

@probablykasper
Copy link

@ruyadorno npm/rfcs#389 is a feature request for npm to respect standard file locations. This issue is a bug where setting npm_config_cache doesn't work, so it's not related to the RFC. Would be great if this could be reopened

@ruyadorno
Copy link
Collaborator

Sorry, my bad! @nlf this sounds like a potential cacache issue 🤔

@ruyadorno ruyadorno reopened this Nov 14, 2022
@ruyadorno ruyadorno added Release 9.x work is associated with a specific npm 9 release Priority 2 secondary priority issue and removed Release 7.x work is associated with a specific npm 7 release labels Nov 14, 2022
@YourFin
Copy link

YourFin commented Dec 21, 2022

I've set npm_config_cache to a non-standard directory and created a non-writable ~/.npm file (touch ~/.npm; chmod a-w ~/.npm); will report back when something breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

4 participants