DEV Community

Richard Beattie
Richard Beattie

Posted on • Originally published at r-bt.com

Firebase emulators:start – getaddrinfo ENOTFOUND localhost localhost:4400

For some reason today firebase start:emulators broke on me. In the morning it worked fine but when I returned after lunch I just got

An unexpected error has occurred.
Enter fullscreen mode Exit fullscreen mode

I tried restarting my laptop, rolling back firestore.rules changes and updating firebase-tools but nothing worked. The firebase-debug.log had some errors talking about not being able to find localhost

port check error: Error: getaddrinfo ENOTFOUND localhost localhost:4400
Enter fullscreen mode Exit fullscreen mode

However, googling this query returned nothing for the first 30 mins. However, googling this query returned nothing. After an hour of experimenting I found the solution. Add the following to your /etc/hosts file:

127.0.0.1 localhost
Enter fullscreen mode Exit fullscreen mode

Well that was an hour wasted. I still don't know how localhost got disassociated with 127.0.0.1.

Top comments (0)