2
votes

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

When I ran 'gulp' command, I met this error, but I don't know how to solve it. I also meet this error when I ran gulp serve command, so I guess this error was caused by gulp-webserver.

My gulp serve task in gulpfile.js is here.

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

Please tell me how to solve this problem.

1
Look at your /etc/hosts file if it contains line: 127.0.0.1 localhostvanadium23
I couldnt find hosts file in my Mac Yosemite...Shinnosuke Komiya
For Yosemite: /private/etc/hosts. Reference: apple.stackexchange.com/questions/158117/…vanadium23
yes, I searched there. but there is only hosts.equiv file. Is this correct?Shinnosuke Komiya
No, it have to be hosts without extension. Without it DNS would not resolve localhost name.vanadium23

1 Answers

1
votes

Problem was with hosts file on Mac Yosemite. To correct behavior in /private/etc/hosts was added following line:

127.0.0.1   localhost