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 #4911

Open
2 tasks done
WhyNotHugo opened this issue May 18, 2022 · 5 comments
Open
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@WhyNotHugo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

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

  • npm: 8.5.5
  • node: v18.1.0
  • OS Name: Linux 5.17.7-arch1-2 GNU/Linux
  • System Model Name: n/a
  • npm config: -
@WhyNotHugo WhyNotHugo added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels May 18, 2022
@WhyNotHugo
Copy link
Author

Previously reported in #3350 and in #1305. Both were closed without any discussion, apparently both times by a bot which assumed the issue had been dealt with.

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2022

Both issues were closed manually by a different human; no idea why you’d think that’s a bot.

I agree this is a bug and not related to the RFC linked in the other issue’s closure.

This issue has no title set, so i doubt it will get proper attention. Can you give it a proper title?

@WhyNotHugo WhyNotHugo changed the title [BUG] <title> [BUG] Extra .npm directory created in user's home while npm_config_cache set May 18, 2022
@WhyNotHugo
Copy link
Author

no idea why you’d think that’s a bot.

The message ends with "Closing: This is an automated message.".

This issue has no title set, so i doubt it will get proper attention. Can you give it a proper title?

My bad, fixed.

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2022

Ah, i see one of those does, yes.

@probablykasper
Copy link

I can't seem to set any config option using environment variables

> echo $npm_config_userconfig
/Users/k/.config/.npmrc
> npm config get userconfig
/Users/k/.npmrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

3 participants