mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +08:00
fix(@angular/cli): process keeps running when analytics are enabled
In newer Node.js versions ng commands do not terminate properly when analytics are enabled. This is because the request is never closed unless a `data` event listener is attached. Closes #25034 and closes #25008
This commit is contained in:
parent
758b0695f3
commit
c0a0f727f8
@ -182,6 +182,9 @@ export class AnalyticsCollector {
|
||||
},
|
||||
},
|
||||
(response) => {
|
||||
// The below is needed as otherwise the response will never close which will cause the CLI not to terminate.
|
||||
response.on('data', () => {});
|
||||
|
||||
if (response.statusCode !== 200 && response.statusCode !== 204) {
|
||||
reject(
|
||||
new Error(`Analytics reporting failed with status code: ${response.statusCode}.`),
|
||||
|
Loading…
x
Reference in New Issue
Block a user