VUE Error: getaddrinfo ENOTFOUND localhost

网络编程 2021-07-04 16:45www.168986.cn编程入门
这篇文章主要介绍了VUE Error: getaddrinfo ENOTFOUND localhost,长沙网络推广觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随长沙网络推广过来看看吧

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

Jins-MBP:helloworld XXX$ npm run dev

> 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 onplete] (dns.js:92:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A plete 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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持狼蚁SEO。

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by