question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: getaddrinfo ENOTFOUND x86_64-conda_cos6-linux-gnu

See original GitHub issue

Version

3.8.2

Reproduction link

https://private-repository…

Environment info

  System:
    OS: Linux 4.19 Manjaro Linux undefined
    CPU: (4) x64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz
  Binaries:
    Node: 11.15.0 - /usr/bin/node
    Yarn: Not Found
    npm: 6.9.0 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 67.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3 
    @vue/babel-preset-app:  3.6.0 
    @vue/babel-preset-jsx:  1.0.0-beta.3 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3 
    @vue/babel-sugar-inject-h:  1.0.0-beta.3 
    @vue/babel-sugar-v-model:  1.0.0-beta.3 
    @vue/babel-sugar-v-on:  1.0.0-beta.3 
    @vue/cli-overlay:  3.7.0 
    @vue/cli-plugin-babel: ^3.6.0 => 3.6.0 
    @vue/cli-plugin-eslint: ^3.6.0 => 3.6.0 
    @vue/cli-plugin-unit-mocha: ^3.6.0 => 3.6.0 
    @vue/cli-service: ^3.7.0 => 3.7.0 
    @vue/cli-shared-utils:  3.6.0 (3.7.0)
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-prettier: ^4.0.1 => 4.0.1 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 (4.7.1)
    vue: ^2.6.10 => 2.6.10 
    vue-cli-plugin-vuetify: ^0.5.0 => 0.5.0 
    vue-eslint-parser:  2.0.3 (5.0.0)
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-router: ^3.0.3 => 3.0.6 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuetify: ^1.5.5 => 1.5.12 
  npmGlobalPackages:
    @vue/cli: 3.8.2

Steps to reproduce

  1. Create a vue project
  2. Try to run it with npm run serve

What is expected?

To build and run the server

What is actually happening?

 INFO  Starting development server...
 10% building 2/2 modules 0 activeevents.js:170                              
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND x86_64-conda_cos6-linux-gnu
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
Emitted 'error' event at:
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1443:12)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! website@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the website@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/terabyte/.npm/_logs/2019-05-30T16_21_56_926Z-debug.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
zrfrankcommented, Jun 6, 2019

It’s also solved my problem as well. Amazing solution @sodatea.

For whom, on macOS, get the same error or with the Nodejs error code EADDRNOTAVAIL (see below the full error message), and you are certain your /etc/hosts set the localhost correctly.

In my case, using iterm2 with zsh,

$ print HOST

x86_64-apple-darwin13.4.0

Which clearly is not localhost.

By setting the $HOST to localhost or empty, i.e.

HOST=localhost

Then the vue serve works as expected,

App running at:
  - Local:   http://localhost:8080/
  - Network: http://localhost:8080/

I’m not sure if this problem is more likely encountered by iTerm user. I’ve inspected the .zshrc and found no sigh of assigning HOST variable. And the mac terminal’s HOST variable has no value.

There are ofc. other solutions like in full app we would pass config directly to webpack, or modify the package.json scripts, i.e. "serve": "vue-cli-service serve --host localhost", which are less elegant.


On macos, when I simply run vue serve or `vue

╰─ vue serve
 INFO  Starting development server...
 10% building 2/2 modules 0 activeevents.js:177
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRNOTAVAIL: address not available 211.137.170.246:8080
    at Server.setupListenHandle [as _listen2] (net.js:1209:19)
    at listenInCluster (net.js:1274:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1413:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:65:10)
Emitted 'error' event at:
    at emitErrorNT (net.js:1253:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:9) {
  code: 'EADDRNOTAVAIL',
  errno: 'EADDRNOTAVAIL',
  syscall: 'listen',
  address: '211.137.170.246',
  port: 8080
}
11reactions
sodateacommented, May 30, 2019

Please check if you have a $HOST environment variable set. If so, delete or overwrite it and try again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js getaddrinfo ENOTFOUND - Stack Overflow
I did already look up this error on stackoverflow, and realized that this is because node.js cannot find the server from DNS (I...
Read more >
Node.js Error Message “getaddrinfo ENOTFOUND localhost ...
If you try to run your JSON server and see this error message “getaddrinfo ENOTFOUND localhost,” it's happening because Webpack cannot find your...
Read more >
Getaddrinfo ENOTFOUND: Get a Premium Solution for the Error
The getaddrinfo ENOTFOUND error can be thrown due to invalid values provided to the options of the http.get() function or a missing line...
Read more >
http.get returns "getaddrinfo ENOTFOUND" error #5436 - GitHub
Hi all, I'm trying to fix following problem since five days. When I'm doing a http.get("http://url/", cb); or http.get(options, cb); ...
Read more >
Node.js error: getaddrinfo ENOTFOUND localhost - Andrew Mok
The error getaddrinfo ENOTFOUND localhost is caused by Webpack cannot found localhost address. To solve it, open the terminal:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found