diff --git a/packages/angular/cli/commands/version-impl.ts b/packages/angular/cli/commands/version-impl.ts index 757f28e10ade..4503cfdc84cd 100644 --- a/packages/angular/cli/commands/version-impl.ts +++ b/packages/angular/cli/commands/version-impl.ts @@ -182,7 +182,16 @@ export class VersionCommand extends Command { private async getPackageManager(): Promise { try { const manager = await getPackageManager(this.context.root); - const version = execSync(`${manager} --version`, { encoding: 'utf8', stdio: 'pipe' }).trim(); + const version = execSync(`${manager} --version`, { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + env: { + ...process.env, + // NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes. + NO_UPDATE_NOTIFIER: '1', + NPM_CONFIG_UPDATE_NOTIFIER: 'false', + }, + }).trim(); return `${manager} ${version}`; } catch {