Skip to content

Commit 7cc33de

Browse files
committed
fix(@angular/cli): disable searching current directory for bare executable names on Windows
Set NoDefaultCurrentDirectoryInExePath environment variable early in CLI initialization so Windows CreateProcess does not search process.cwd() when resolving bare command names. Fixes #33755
1 parent 194be20 commit 7cc33de

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/angular/cli/lib/init.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ let forceExit = false;
3939
// Ignore failure to change directory
4040
}
4141
}
42+
43+
// Ensure Windows CreateProcess does not search the current directory for bare executable names.
44+
process.env['NoDefaultCurrentDirectoryInExePath'] = '1';
4245
}
4346

4447
/**
@@ -48,6 +51,7 @@ let forceExit = false;
4851
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
4952
*/
5053
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
54+
5155
const rawCommandName = process.argv[2];
5256

5357
/**

0 commit comments

Comments
 (0)