ng help
lists Listens on all interfaces by default under the ng serve section. However, in fact the server listens on 127.0.0.1
only.
Please, set the node.js to 0.0.0.0
or change the message.
ng --version
. If there's nothing outputted, please runnode --version
and paste the result here:angular-cli: 1.0.0-beta.15
node: 6.6.0
os: win32 x64
ng init; ng serve
Please, set the node.js to 0.0.0.0 or change the message.
Do you know how to do that? I am facing the same issue.
Nvm. Works with command ng serve --host 0.0.0.0
Hello!
I've launched ng serve using the command above, but when I'm trying to access the server through public IP address, I'm getting the error: Invalid Host header
. How do I overcome this? How do I make it accept any host header?
Thank you!
The full command should look like this: $ ng serve --port 8080 --host 0.0.0.0 --disable-host-check
, the --disable-host-check
option will allow to use any host header. The following thread, could also be useful: https://github.com/angular/angular-cli/issues/6349.
ng serve --port 8080 --host 0.0.0.0
This solution works fine
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Nvm. Works with command
ng serve --host 0.0.0.0