Skip to content

Commit 5fc8539

Browse files
Daniel15bestander
authored andcommitted
Fix global module executable path on Windows (#3233)
1 parent cd4a8d7 commit 5fc8539

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

resources/winsetup/Yarn.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<Environment
4040
Id="BinPath"
4141
Name="PATH"
42-
Value="[LocalAppDataFolder]Yarn\.bin"
42+
Value="[LocalAppDataFolder]Yarn\bin"
4343
Permanent="no"
4444
Part="last"
4545
Action="set"

src/cli/commands/global.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ function getGlobalPrefix(config: Config, flags: Object): string {
7777
} else if (process.env.PREFIX) {
7878
return process.env.PREFIX;
7979
} else if (process.platform === 'win32') {
80+
if (process.env.LOCALAPPDATA) {
81+
return path.join(process.env.LOCALAPPDATA, 'Yarn', 'bin');
82+
}
8083
// c:\node\node.exe --> prefix=c:\node\
8184
return path.dirname(process.execPath);
8285
} else {

0 commit comments

Comments
 (0)