Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/angular/cli/lib/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ import { VERSION } from '../src/utilities/version';
let forceExit = false;

(async (): Promise<typeof import('./cli').default | null> => {
/**
* On Windows, ensure process.cwd() uses uppercase drive letter casing.
* 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.
*/
if (process.platform === 'win32') {
const cwd = process.cwd();
if (/^[a-z]:/.test(cwd)) {
try {
process.chdir(cwd[0].toUpperCase() + cwd.slice(1));
} catch {
// Ignore failure to change directory
}
}
}

/**
* Disable Browserslist old data warning as otherwise with every release we'd need to update this dependency
* which is cumbersome considering we pin versions and the warning is not user actionable.
Expand Down