Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to start angular2 project generated with angular-cli due to getaddrinfo ENOTFOUND error

I am using Mac, OSX El Capitan 10.11.2, and trying to start angular2 application using angular-cli. As per document I have run the following

$sudo ng new dashboard
$cd dashboard
$sudo ng serve
Password:
getaddrinfo ENOTFOUND localhost
Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

But I am getting above erro which I don't understand.

like image 756
Madasu K Avatar asked Dec 15 '22 02:12

Madasu K


1 Answers

try with this command: ng serve --port 4200 --host 0.0.0.0

like image 84
Guillermo Gutiérrez Avatar answered Dec 28 '22 11:12

Guillermo Gutiérrez