当前位置:首页 » 《随便一记》 » 正文

Error: getaddrinfo ENOTFOUND localhost

6 人参与  2024年04月27日 14:42  分类 : 《随便一记》  评论

点击全文阅读


一、背景:

在启动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

 


点击全文阅读


本文链接:http://zhangshiyu.com/post/101120.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1