VUE Error localhost VUE Error: getaddrinfo ENOTFOUND localhost

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

VUE Error localhost VUE Error: getaddrinfo ENOTFOUND localhost

爱红旗渠   2021-03-28 我要评论
想了解VUE Error: getaddrinfo ENOTFOUND localhost的相关内容吗,爱红旗渠在本文为您仔细讲解VUE Error localhost的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:VUE,Error,localhost,VUE,localhost,下面大家一起来学习吧。

本文介绍了VUE Error: getaddrinfo ENOTFOUND localhost,分享给大家。具体如下:

Jins-MBP:helloworld XXX$ npm run dev

> helloworld@1.0.0 dev /Users/XXX/Documents/develop/front/helloworld
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 10% building modules 2/4 modules 2 active .../develop/front/helloworld/src/main.jsevents.js:183
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND localhost
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! helloworld@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the helloworld@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/XXX/.npm/_logs/2018-04-18T01_01_10_246Z-debug.log

根据报错内容,推断是localhost的问题。有可能是localhost没有绑定127.0.0.1。

修改方法:

添加host配置

127.0.0.1 localhost

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们