运行:
npm run dev 出现下面错 This is probably not a problem with npm. There is likely additional logging output above.
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! lx@1.0.0 dev: `node build/dev-server.js wx`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lx@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! 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
】
vue 不是不是内部命令或外部命令
找到npm下的路径,配置环境变量;