vue脚手架 使用npm run dev 遇到的错误问题

mac 系统 执行 sudo npm run dev


first-vue@1.0.0 dev /Users/xxx//WebstormProjects/first-vue
> node build/dev-server.js


events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::8080
    at Object.exports._errnoException (util.js:953:11)
    at exports._exceptionWithHostPort (util.js:976:20)
    at Server._listen2 (net.js:1253:14)
    at listen (net.js:1289:10)
    at Server.listen (net.js:1385:5)
    at EventEmitter.listen (/Users/ym-os/WebstormProjects/first-vue/node_modules/.4.14.0@express/lib/application.js:617:24)
    at Object.<anonymous> (/Users/ym-os/WebstormProjects/first-vue/build/dev-server.js:60:22)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:449:3


npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! first-vue@1.0.0 dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the first-vue@1.0.0 dev script 'node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the first-vue package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs first-vue
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls first-vue
npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ym-os/WebstormProjects/first-vue/npm-debug.log

该问题是因为脚手架工具默认监听的是8080端口,此时是8080端口被占用情况导致的。

找出8080端口占用进程然后杀死

执行sudo lsof -i :8080

COMMAND PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd    79  root    6u  IPv6 0x16935b8002e27567      0t0  TCP *:http-alt (LISTEN)

执行sudo kill -9 79 

再执行sudo npm run dev,然后搭建成功.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值