简体   繁体   中英

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

I am trying to use node-ar-drone package for controlling and interfacing with an AR Parrot Drone 2 but I get the following errors after connecting to the wireless network of the drone in my 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$ 

I wonder what the error might be?

For more information, I have followed these tutorials:

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

install it using this command:

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

PS: I am literally running an example in the example directory and I am not changing any code.

In png-stream.js change the following lines:

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

To a different port, 8081 for instance:

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

You need sudo/admin priviliges on your machine to run it on port 8080 or any port used. You will need to start with sudo on linux.

sudo npm start 

在我的ubuntu上做了诀窍并做出反应

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM