npm run server报错

Posted chen55555

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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地址改成本地地址即可

 

以上是关于npm run server报错的主要内容,如果未能解决你的问题,请参考以下文章

npm run dev 报错:missing script:dev

Vue 项目: npm run dev b报错 “'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序 或批处理文件。”

vue项目,npm install后,npm run dev报错问题

nuxt.js 初始化 npm run dev 报错

npm run dev报错,events.js:160 throw er; // Unhandled 'error' event

关于vue使用 npm run dev报错原因