Error on gulp webserver

Asked 2 years ago, Updated 2 years ago, 150 views

 events.js:85
  below;// Unhandled 'error' event
        ^
Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:44:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)

When I hit the gulp command, this error rarely occurs and the server does not wake up.The rare thing I wrote is that once you sleep and then wake up in the morning and hit this command, it can move.

This error appears even if you press the gulp serve command, so it appears to be an error around the gulp-webserver.
And sometimes it comes out like this.

...Uhoh. Got error getaddrinfo ENOTFOUND localhost...
Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:44:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
events.js —85
      below;// Unhandled 'error' event
            ^
Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:44:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)

The server tasks in gulpfile.js are as follows

 gulp.task('serve', function(){
  gulp.src('app/')
     .pipe(webserver({
       load: true,
       directoryListening: true,
       open —true
     }));
});

I don't know the cause, so I would appreciate it if you could let me know.

javascript node.js gulp

2022-09-30 20:24

1 Answers

to /private/etc/hosts

127.0.0.1 localhost

Add the

If there is no hosts file, create it


2022-09-30 20:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.