vue执行cnpm run dev启动报错[email protected] dev: `node build/dev-server.js`

具体错误信息如下:

[email protected] dev /Users/suyifeng/Downloads/mobileOS
node build/dev-server.js

[HPM] Proxy created: /api -> http://localhost:18888/
[HPM] Proxy rewrite rule created: "^/api" ~> "/api"
[HPM] Proxy created: /ftpFile -> http://localhost:18888/
[HPM] Proxy rewrite rule created: "^/ftpFile" ~> "/ftpFile"

Starting dev server...
events.js:167
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::8080
at Server.setupListenHandle [as _listen2] (net.js:1336:14)
at listenInCluster (net.js:1384:12)
at Server.listen (net.js:1471:7)
at Function.listen (/Users/suyifeng/Downloads/mobileOS/node_modules/[email protected]@express/lib/application.js:618:24)
at Object. (/Users/suyifeng/Downloads/mobileOS/build/dev-server.js:83:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1363:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: node build/dev-server.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! /Users/suyifeng/.npm/_logs/2018-11-06T08_38_33_649Z-debug.log
报这个错是因为端口号被占用了,下面是解决办法:
在config/index.js中修改port,改成没被占用的端口号就可以了。

你可能感兴趣的:(vue执行cnpm run dev启动报错[email protected] dev: `node build/dev-server.js`)