How I fixed Angular "ng build", "ng new" etc not terminating

Problem

On my Desktop, Angular commands such as

ng build

or

ng new

worked successfully, but they didnt stop / terminate after running the command. Instead, they just waited indefinitely without any output.

Solution

This is related to analytics being enabled, see this GitHub post.

In order to fix it, run

ng analytics disable --global

It will print

Global setting: disabled
Local setting: enabled
Effective status: disabled

and it won’t terminate the first time you do this. Just press Ctrl+C to force stop it.

After that, any command will exit after finishing its task

Underlying problem

I suspect this has something to do with IPv6 configuration since my Desktop’s IPv6 network setup is somewhat broken at the moment. However, I did not do any further research into this.