一、背景:
在啟動(dòng)vue ui的時(shí)候,報(bào)錯(cuò)了。
報(bào)錯(cuò)信息:
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文件中,加入文章來源:http://www.zghlxwxcb.cn/news/detail-591342.html
127.0.0.1 localhost
?文章來源地址http://www.zghlxwxcb.cn/news/detail-591342.html
到了這里,關(guān)于Error: getaddrinfo ENOTFOUND localhost的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!