使用vs code打開開發中的專案資料夾
使用的框架是vue.js及vue.cli
作業系統windows 10
npm run dev 之前有先npm install
npm run dev之後出現了以下error
Starting dev server...
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8080
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Function.listen (D:\Project\V_1\PC\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (D:\Project\V_1\PC\build\dev-server.js:83:18)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lamborfrontend_vue@1.0.0 dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lamborfrontend_vue@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\abner\AppData\Roaming\npm-cache\_logs\2017-12-25T03_43_22_102Z-debug.log
PS D:\Project\V_1\PC>
同事開得起來但作業系統不一樣
不知該從何著手除錯
看起來是 8080 Port 已經被佔用了。
你應該是用 webpack-dev-server
吧?
打開 webpack-dev-server.js
找到 devServer
-> port
改成別的 Port:
{
// ...
"devServer": {
"port": 8888
},
// ...
}