Skip to content

Commit dfb9466

Browse files
plasticrakeraineorshine
authored andcommitted
fix: use HOME environment variable for npm configuration file lookup (#1399)
1 parent 522a3b1 commit dfb9466

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/libnpmconfig/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const NpmConfig = figgyPudding(
2424
)
2525

2626
const ConfigOpts = figgyPudding({
27-
cache: { default: path.join(os.homedir(), '.npm') },
27+
cache: { default: path.join(process.env.HOME || os.homedir(), '.npm') },
2828
configNames: { default: ['npmrc', '.npmrc'] },
2929
envPrefix: { default: /^npm_config_/i },
3030
cwd: { default: () => process.cwd() },
3131
globalconfig: {
3232
default: () => path.join(getGlobalPrefix(), 'etc', 'npmrc'),
3333
},
34-
userconfig: { default: path.join(os.homedir(), '.npmrc') },
34+
userconfig: { default: path.join(process.env.HOME || os.homedir(), '.npmrc') },
3535
})
3636

3737
module.exports.read = getNpmConfig

0 commit comments

Comments
 (0)