vite 啟動項目報錯
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)
原因 dns.js
dns 解析不到 xxxx域名(如本例中的 localhost) 對應(yīng)IP地址,而所以需要把 xxxx域名 指向本地IP127.0.0.1
操作 host文件
host文件位置: 修改host文件c://Windows/System32/drivers/etc/hosts
文件中 #
符號 是注釋作用,該行不會執(zhí)行文章來源:http://www.zghlxwxcb.cn/news/detail-735733.html
host文件樣式:文章來源地址http://www.zghlxwxcb.cn/news/detail-735733.html
到了這里,關(guān)于getaddrinfo ENOTFOUND的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!