0

I've got an issue with a machine that's supposed to be able to run offline.

I can pull the cable after my application is running, but during unplugged start I get the following error:

May  6 23:04:50 myco serve[4121]: (node:4121) UnhandledPromiseRejectionWarning: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443
May  6 23:04:50 myco serve[4121]:     at Object._errnoException (util.js:1022:11)
May  6 23:04:50 myco serve[4121]:     at errnoException (dns.js:55:15)
May  6 23:04:50 myco serve[4121]:     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
May  6 23:04:50 myco serve[4121]: (node:4121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
May  6 23:04:50 myco serve[4121]: (node:4121) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It appears that dns.js is part of webpack/node-libs-browser but thats as far as I can seem to figure out.... I can't find GetAddrInfoReqWrap anywhere in my source tree, or getaddrinfo for that matter. Searching around there's a lot of info with people getting similar errors when deliberately trying to use npm, but thats not what I'm doing. I should have everything I need already on the machine.

3 Answers3

0

Apparently this is a problem with serve.

Serve >6.5.3 apparently has an issue where it tries to contact the registry. Downgrade of serve to 6.5.3 solves this particular issue.

this is documented in https://github.com/zeit/serve/issues/348

not sure why serve would need to contact the registry.

0

noafterglow is right, but just for reference, rolling back to version 6.5.3 of serve can be accomplished with

npm install -g serve@6.5.3

Source: this post

jwind
  • 1
  • 2
0

I ran into exactly this error when trying to serve a VueJs app from a different VM from where the code was developed originally.

The file vue.config.js read :

 module.exports = {
   devServer: {
     host: 'tstvm01',
     port: 3030,
   },
 };

When served on the original machine the start up output is :

App running at:
- Local:   http://tstvm01:3030/ 
- Network: http://tstvm01:3030/

Using the same settings on a VM tstvm07 got me a very similar error to the one the OP describes:

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

Error: getaddrinfo EAI_AGAIN
    at Object._errnoException (util.js:1022:11)
    at errnoException (dns.js:55:15)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

If it ain't already obvious, changing vue.config.js to read ...

 module.exports = {
   devServer: {
     host: 'tstvm07',
     port: 3030,
   },
 };

... solved the problem.

Martin Bramwell
  • 2,003
  • 2
  • 19
  • 35