Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: getaddrinfo ENOTFOUND localhost #4092

Closed
ejerskov opened this issue Jul 18, 2019 · 5 comments
Closed

Error: getaddrinfo ENOTFOUND localhost #4092

ejerskov opened this issue Jul 18, 2019 · 5 comments
Labels

Comments

@ejerskov
Copy link

When running ionic serve --lab I suddenly get this error:

Output:

[INFO] Waiting for connectivity with ng...
> ionic-lab http://localhost:8100 --host localhost --port 8200 --project-type angular --app-name foodioApp --app-version 0.0.1
[lab] events.js:174
[lab]       throw er; // Unhandled 'error' event
[lab]       ^
[lab] Error: getaddrinfo ENOTFOUND localhost
[lab]     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
[lab] Emitted 'error' event at:
[lab]     at GetAddrInfoReqWrap.doListen [as callback] (net.js:1455:12)
[lab]     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:17)

[ERROR] ionic-lab has unexpectedly closed (exit code 1).
        
        The Ionic CLI will exit. Please check any output above for error details.

My ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.6.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 6 other plugins)

System:

   ios-deploy : 1.9.4
   ios-sim    : ios-sim/9.0.0-dev.1 darwin-x64 node-v10.15.1
   NodeJS     : v10.15.1 (/usr/local/bin/node)
   npm        : 6.4.1
   OS         : macOS Mojave
   Xcode      : Xcode 10.2.1 Build version 10E1001

Other Information:
I have checked my etc/hosts file and this is in the top (with other stuff below):

##
# 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
@ionitron-bot ionitron-bot bot added the triage label Jul 18, 2019
@imhoffd
Copy link
Contributor

imhoffd commented Jul 18, 2019

Are you able to access http://localhost:8100 in your browser?

@ejerskov
Copy link
Author

No, but I just tried ionic serve and that worked fine on http://localhost:8100

@imhoffd
Copy link
Contributor

imhoffd commented Jul 18, 2019

Would the other stuff below mess up your hosts file? Can you try it with just the vanilla hosts file? There are lots of resources online you can try to fix this:

@ejerskov
Copy link
Author

Yes, I just tried with only this in the host file and restarted my mac:

##
##
# 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

@liamdebeasi
Copy link
Contributor

Hi everyone,

We recently deprecated Ionic Labs in favor of using the built-in browser tools for mobile emulation. These tools more accurately simulate a mobile environment than Ionic Labs does. We have documentation for getting set up with the browser dev tools on our documentation website: https://ionicframework.com/docs/developing/previewing

I am going to close this, but let me know if there are any questions.

@liamdebeasi liamdebeasi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants