vue项目接口域名动态的获取方法
447
2023-02-06
VUE Error: getaddrinfo ENOTFOUND localhost
本文介绍了vue Error: getaddrinfo ENOTFOUND localhost,分享给大家。具体如下:
Jins-MBP:hellhttp://oBzwWHQworld 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 notBzwWHQ 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/2018BzwWHQ-04-18T01_01_10_246Z-debug.log
根据报错内容,推断是localhost的问题。有可能是localhost没有绑定127.0.0.1。
修改方法:
添加host配置
127.0.0.1 localhost
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~