[BUG] Extra .npm directory created in user's home while npm_config_cache set
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by running npm install with npm_config_cache set to a non-default location on the listed environment, then inspect the install's cache handling. Done means npm uses the configured cache and does not create an extra ~/.npm directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100