fix(@angular/cli): normalize Windows drive-letter casing for process.cwd - #33753
Merged
alan-agius4 merged 1 commit intoAug 5, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a normalization step for Windows environments in packages/angular/cli/lib/init.ts to ensure the drive letter in the current working directory is uppercase, preventing ESM module duplication and path lookup mismatches. The review feedback recommends wrapping the process.chdir call in a try...catch block to prevent potential CLI crashes if the directory change fails, and optimizing the logic by caching the result of process.cwd() to avoid redundant system calls.
Windows cmd.exe and VS Code terminals often preserve lowercase drive letters (e.g. c:\...), which causes ESM module duplication in Node.js (e.g. loading 'vitest' twice) and path lookup mismatches in tools like Vite and esbuild. Normalizing process.cwd() early in CLI startup ensures consistent uppercase drive letter casing across all builders, worker threads, and ESM module resolution on Windows.
clydin
force-pushed
the
fix/win32-cwd-drive-letter-casing
branch
from
August 4, 2026 23:58
ba41052 to
31b5f77
Compare
alan-agius4
approved these changes
Aug 5, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Windows
cmd.exeand VS Code terminals often preserve lowercase drive letters (e.g.c:\...), which causes ESM module duplication in Node.js (e.g. loadingvitesttwice) and path lookup mismatches in tools like Vite and esbuild.Normalizing
process.cwd()early in CLI startup ensures consistent uppercase drive letter casing across all builders, worker threads, and ESM module resolution on Windows.