Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node server error when "node index.js" (EADDRINUSE)

On Mint Maya 64, if I run "node index.js" (v0.10.21) in terminal, I get this error:

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> (/home/USER/Desktop/server/index.js:73: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)

my apache2 server is stopped, and there is no other node server running.

I tried "killall node" -> node: no process found

With "sudo netstat -tulpn" there is no sign of anything listening on port 80.

Because it's the first node server experiment for me, I don't have a clue how to proceed.

like image 651
user3150649 Avatar asked Aug 31 '26 10:08

user3150649


1 Answers

Check which port is used by Node in your index.js file, for a start. There is another application which uses this port. So you have two options:

  • kill this app
  • use another port for Node app
like image 132
Andrei Karpushonak Avatar answered Sep 02 '26 03:09

Andrei Karpushonak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!