Skip to content

Commit

Permalink
Improve Windows compatibility (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoygcq authored Nov 16, 2022
1 parent 7882d04 commit 3c37030
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ const getGlobalNpmrc = () => {

const getDefaultNpmPrefix = () => {
if (isWindows) {
const {APPDATA} = process.env;
// `c:\node\node.exe` → `prefix=c:\node\`
return path.dirname(process.execPath);
return APPDATA ? path.join(APPDATA, 'npm') : path.dirname(process.execPath);
}

// `/usr/local/bin/node` → `prefix=/usr/local`
Expand Down

0 comments on commit 3c37030

Please sign in to comment.