webpack getaddrinfo ENOTFOUND localhost错误

原因 没有指定 localhost
在host 文件中添加
127.0.0.1 localhost

1
2
3
4
5
6
7
events.js:141
throw er; // Unhandled 'error' event
^

Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:27:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:78:26)