Skip to content

Commit 465073b

Browse files
committed
fix(@angular/cli): disable npm update notifier in package manager host
The NPM update notifier can prevent child processes from closing promptly, causing them to hang until a timeout occurs (up to 3 minutes). This change disables the update notifier by setting the `NO_UPDATE_NOTIFIER` and `NPM_CONFIG_UPDATE_NOTIFIER` environment variables when spawning package manager processes. (cherry picked from commit 069e3d3)
1 parent 3d8beeb commit 465073b

File tree

1 file changed

+3
-0
lines changed
  • packages/angular/cli/src/package-managers

1 file changed

+3
-0
lines changed

packages/angular/cli/src/package-managers/host.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ export const NodeJS_HOST: Host = {
137137
env: {
138138
...process.env,
139139
...options.env,
140+
// NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.
141+
NO_UPDATE_NOTIFIER: '1',
142+
NPM_CONFIG_UPDATE_NOTIFIER: 'false',
140143
},
141144
} satisfies SpawnOptions;
142145
const childProcess = isWin32

0 commit comments

Comments
 (0)