ExpressJS - 抛出未处理的错误事件 [英] ExpressJS - throw er Unhandled error event

查看:102
本文介绍了ExpressJS - 抛出未处理的错误事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令创建了expressjs应用程序:

I created expressjs application using the following commands:

express -e folderName
npm install ejs --save
npm install

当我运行应用程序:节点应用程序.js ,我有以下错误:

When I run the application with: node app.js, I have the following errors:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: listen EADDRINUSE
    at errnoException (net.js:884:11)
    at Server._listen2 (net.js:1022:14)
    at listen (net.js:1044:10)
    at Server.listen (net.js:1110:5)
    at Object.<anonymous> (folderName/app.js:33:24)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

如何修复?

推荐答案

您已经运行另一台服务器使用与8080相同的端口。

You had run another server use the same port like 8080.

也许您已经运行其他shell中的节点应用程序请关闭它并重新运行。

Maybe you had run node app in other shell, Please close it and run again.

这篇关于ExpressJS - 抛出未处理的错误事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆