错误码:events.js:141 throw er; // Unhandled ‘error’ event—解决办法

错误码:events.js:141 throw er; // Unhandled ‘error’ event—解决办法

具体错误信息:

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

Error: listen EADDRINUSE 127.0.0.1:8088
    at Object.exports._errnoException (util.js:873:11)
    at exports._exceptionWithHostPort (util.js:896:20)
    at Server._listen2 (net.js:1250:14)
    at listen (net.js:1286:10)
    at net.js:1395:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\                                                                                                                node_modules\\npm\\bin\\npm-cli.js" "run" "dev_win"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! mmall-fe@1.0.0 dev_win: `set WEBPACK_ENV=dev && webpack-dev-server --in                                                                                                                line --port 8088`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmall-fe@1.0.0 dev_win script 'set WEBPACK_ENV=dev && web                                                                                                                pack-dev-server --inline --port 8088'.
npm ERR! This is most likely a problem with the mmall-fe package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     set WEBPACK_ENV=dev && webpack-dev-server --inline --port 8088
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mmall-fe
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls mmall-fe
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\mygit\mmall-fe\npm-debug.log

错误原因:

端口号被占用。

解决方法:

查找被占用端口号,杀掉,重启。

1.cmd查询使用的端口号是否被占用:
netstat  -aon|findstr  "8088"
按回车显示占用8088端口对应的程序的PID号;
2.根据PID号找到对应的程序:继续输入命令:
tasklist|findstr "6376"
按回车后显示出占用该端口的程序;
3.按快捷键“Ctrl+Shift+Esc”调出Windows任务管理器,根据PID/
程序对应名称结束该程序进程即可。
4.重新编译项目即可。

其实只要获得PID就可以杀进程了~~~

你可能感兴趣的:(错误码:events.js:141 throw er; // Unhandled ‘error’ event—解决办法)