npm run server报错

从git上clone的vue项目npm install后npm run server报错

$ npm run dev

> [email protected] dev E:\pythonProject\luffy\luffyvue
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 10% building modules 0/1 modules 1 active ... webpack/hot/dev-server ./src/main 10% building modules 1/2
modules 1 active ...ode_modules\webpack\hot\dev-server 10% building modules 2/3 modules 1 active
...honProject\luffy\luffyvue\src\main 12% building modules 24/44 modules 20 active ...\element-ui\lib\theme-chalk\index.cssevents.js:174 throw er; // Unhandled 'error' event ^ Error: listen EADDRNOTAVAIL: address not available 12.20.22.14:8080 at Server.setupListenHandle [as _listen2] (net.js:1260:19) at listenInCluster (net.js:1325:12) at GetAddrInfoReqWrap.doListen [as callback] (net.js:1458:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10) Emitted 'error' event at: at emitErrorNT (net.js:1304:8) at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js` 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\14612\AppData\Roaming\npm-cache\_logs\2019-06-16T14_53_41_465Z-debug.log

最后发现是config/index.js中的host地址问题,把host地址改成本地地址即可

猜你喜欢

转载自www.cnblogs.com/chen55555/p/11037379.html