Error: getaddrinfo ENOTFOUND localhost
一、背景:
在启动vue ui的时候,报错了。
(图片来源网络,侵删)
报错信息:
node:events:491
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND localhost
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
(图片来源网络,侵删)
Emitted 'error' event on WebSocketServer instance at:
at Server.emit (node:events:513:28)
at GetAddrInfoReqWrap.doListen [as callback] (node:net:1934:12)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:17) {
errno: -3008,
code: 'ENOTFOUND',
(图片来源网络,侵删)
syscall: 'getaddrinfo',
hostname: 'localhost'
}
Node.js v18.14.2
二、解决办法
修改host,在hosts文件中,加入
127.0.0.1 localhost
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。
还没有评论,来说两句吧...