javascript - 事件.js :72 throw er;//Unhandled 'error' event

标签 javascript node.js npm augmented-reality ar.drone

我正在尝试使用 node-ar-drone 包来控制和连接 AR Parrot Drone 2,但在我的 OSX Yosemite 中连接到无人机的无线网络后出现以下错误:

587214779:examples mona$ node png-stream.js 
Connecting png stream ...

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1127:5)
    at Object.<anonymous> (/Users/mona/iotlab/armyo/node-ar-drone/examples/png-stream.js:28:8)
    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)
587214779:examples mona$ 

我想知道错误可能是什么?

有关更多信息,我已遵循以下教程:

git clone https://github.com/felixge/node-ar-drone.git

使用此命令安装它:

npm install git://github.com/felixge/node-ar-drone.git

P.S.:我实际上是在示例目录中运行一个示例,我没有更改任何代码。

最佳答案

在 png-stream.js 中更改以下行:

server.listen(8080, function() {
  console.log('Serving latest png on port 8080 ...');
});

到不同的端口,例如 8081:

server.listen(8081, function() {
  console.log('Serving latest png on port 8081 ...');
});

关于javascript - 事件.js :72 throw er;//Unhandled 'error' event,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32594530/

相关文章:

node.js - 当我在前台有一个 NodeJS 应用程序作为端点时,如何在后台容器内运行 cron 作业?

node.js - Node JS : Is is possible to show the stack trace of a calling async function?

node.js - npm install将项目移到另一个目录时出现错误

javascript - 设置十进制数的格式

javascript - Google Cloud Pub/Sub 在消息吞吐量低时触发高延迟

ruby-on-rails - 如何在rails中使用npm包?

npm - 如何为项目级 `.npmrc` 指定当前工作目录?

javascript - emberjs - 在更大的模板中有条件地渲染模板

javascript - 通过在 jQuery 中单击将 INPUT FILE 值复制到 INPUT TEXT

JavaScript 花括号参数作为函数参数