I'm trying to compile a simple (first) Angular project on Visual Studio. I'm connected to a Hotspot. When I run ng serve
I get the following error:
An unhandled exception occurred: listen EADDRNOTAVAIL: address not available 40.68.249.35:4200 See "/private/var/folders/jc/mgkz9l6x7h52sz7dcp8mrr_m0000gn/T/ng-3legRp/angular-errors.log" for further details.
[error] Error: listen EADDRNOTAVAIL: address not available 40.68.249.35:4200
at Server.setupListenHandle [as _listen2] (net.js:1296:21)
at listenInCluster (net.js:1361:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1498:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:68:8)
How can I solve this error? Currently I always use the command ng serve --host 0.0.0.0
which works...
Go to your angular.json, Have you specified a host?
"serve": {
...
"development": {
...
"host": "example.com",
},
Make sure example.com is included in your /etc/hosts file.
$ vi /etc/hosts
127.0.0.1 localhost example.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With