npm run dev
启动 报错 dev:
node build/dev-server.js
解决npm run dev
启动报错如下:
[HPM] Proxy rewrite rule created: “^/api” ~> “”
Starting dev server…
events.js:137
throw er; // Unhandled ‘error’ event
^
Error: listen EADDRINUSE :::8088
at Object._errnoException (util.js:1003:13)
at _exceptionWithHostPort (util.js:1024:20)
at Server.setupListenHandle [as _listen2] (net.js:1366:14)
at listenInCluster (net.js:1407:12)
at Server.listen (net.js:1495:7)
at Function.listen (/workCode/times_property.app.user/node_modules/express/lib/application.js:618:24)
at Object. (/workCode/times_property.app.user/build/dev-server.js:82:18)
at Module._compile (module.js:660:30)
at Object.Module._extensions…js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:617:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weike@1.0.0 dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weike@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! /Users/mcya/.npm/_logs/2018-08-28T02_36_05_633Z-debug.log
- 之所以会报这个错是因为项目启动的端口号被占用了,更改端口即可。
- 即:在
config/index.js
中更改port
端口号的值即可。注意,是没有被占用的端口号方可。