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

原因: 启动服务时端口被占用

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

Error: listen EADDRINUSE 127.0.0.1:3000
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1259:14)
at listen (net.js:1295:10)
at net.js:1405:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)

修改端口号重新启动服务就可以了

你可能感兴趣的:(npm run dev报错,events.js:160 throw er; // Unhandled 'error' event)