close

[Solved] Nodemon: Error: listen EADDRINUSE: address already in use :::5000

Hello Guys, How are you all? Hope You all Are Fine. Today I am just run my nodejs Project with nodemon but I am facing following error Nodemon: Error: listen EADDRINUSE: address already in use :::5000 in nodejs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Nodemon: Error: listen EADDRINUSE: address already in use :::5000 Error Occurs ?

I am just run my nodejs project with nodemon but facing the following error in my stack track.

Error: listen EADDRINUSE: address already in use :::5000

How To Solve Nodemon: Error: listen EADDRINUSE: address already in use :::5000 Error ?

  1. How To Solve Nodemon: Error: listen EADDRINUSE: address already in use :::5000 Error?

    To Solve Nodemon: Error: listen EADDRINUSE: address already in use :::5000 Error Just make sure You might have other instances of the terminal that is already running your node server. If you are using Visual Studio Code, check your terminals.

  2. Nodemon: Error: listen EADDRINUSE: address already in use :::5000

    To Solve Nodemon: Error: listen EADDRINUSE: address already in use :::5000 Error Just make sure You might have other instances of the terminal that is already running your node server. If you are using Visual Studio Code, check your terminals.

Solution 1

Just make sure You might have other instances of the terminal that is already running your node server. If you are using Visual Studio Code, check your terminals.

Solution 2

--delay helped me to fix both of issues

  • on auto-restart
  • stopping with ctrl-cnodemon --delay 500ms app.js

Solution 3

You can try running your server on some other port like 3000.

If you still want to use the same port, then you can use the following command to get the list of the running processes on that particular port:

lsof -i tcp:3000 

Use following command in terminal to kill that running port

sudo kill -9 $(lsof -i tcp: 3000 -t)

Solution 4

I used this to fix the same problem

process.once('SIGUSR2', 
  function () { 
    process.kill(process.pid, 'SIGUSR2'); 
  }
);

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Leave a Comment