vue相关运行打包遇见的常见错误

运行:

1 npm run dev 出现下面错

Error: listen EADDRNOTAVAIL 111.166.1.29:8081
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at Server.setupListenHandle [as _listen2] (net.js:1338:19)
    at listenInCluster (net.js:1396:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1505:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `node build/dev-server.js wx`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\linxue\AppData\Roaming\npm-cache\_logs\2018-12-29T05_52_00_200Z-debug.log

【注意上面,监听的是111.166.1.29,但是我本机ip(cmd->ipconfig)不是这个,我也没有配置host为111.166.1.29,但是按照脚手架配置的自动获取我的ip,最后查看我本机的host文件,发现host(C:\Windows\System32\drivers\etc)中 :

111.166.1.29  localhost

所以这里监听本地host  111.166.1.29,但这ip不存在啊,所以就运行监听报错了,将ip该自己本机ip就好

【本机ip】  localhost

猜你喜欢

转载自blog.csdn.net/github_38928905/article/details/85337959