ng --version
. If there's nothing outputted, please runnode --version
and paste the result here:These two links seem to indicate that there is some problem with your localhost
address:
http://stackoverflow.com/questions/35757799/webpack-dev-server-cant-find-localhost
https://github.com/webpack/webpack-dev-server/issues/420
You can also see this section of the readme for a way to serve on a different address via the --host
option:
https://github.com/angular/angular-cli#generating-and-serving-an-angular2-project-via-a-development-server
All started with the same error _(+ Firefox redirection from http://localhost to www.localhost.com)_ and 4h later..."still stuck"!
Long story short, it appears Ive accidently "corrupted" the /etc/hosts
file when, for the anecdote, yesterday I set a new alias (who didn't worked) for my RaspberryPi IP >> without sudo
<<
When Ive cat /etc/hosts
the cat output was one messy line.
So I : cd /etc
, sudo rm hosts
, sudo nano hosts
then paste and save the standard lines
I am getting below error while trying to run my angular application.....what to do to fix it?
getaddrinfo ENOTFOUND localhost
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
@nebiljabari thanks that's work for me
I can confirm adding the standard lines back for the definition of localhost on the hosts file did it form me.
##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
It worked perfectly, Thanks :)
Worked like a charm! Had changed the hosts file while setting up a hadoop cluster and never reverted to the original. Thank you 馃憤
Worked guys awesome community!!! 馃憤 馃挴
Thanks :)
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
I can confirm adding the standard lines back for the definition of localhost on the hosts file did it form me.