fix: use HOME environment variable for npm configuration file lookup #1399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On a Windows machine I am forced to work on, my
$HOME
environment variable is different that whatos.homedir()
returns. This change first looks at$HOME
to mimic how npm finds the user configuration file.See: https://github.com/npm/cli/blob/dd39de7d1da743cbd33b671fa96f66667109b451/workspaces/config/lib/index.js#L313
Documentation: https://github.com/npm/cli/blob/7f4e66772ee631158b47fcfcd8e22b7b6b9b9cce/docs/lib/content/using-npm/config.md?plain=1#L48