How To Fix “Error: listen EADDRINUSE: address already in use :::8001” in Nodejs


This error occurs in your nodejs project when you have a project that did not shut down properly. It will leave the port still running and used, so if you try to run again your Nodejs project you will get this error


Method 1

First, we need to find the PID of the port associated with it. To find that we need to run this command:

sudo lsof -i :<port_number>

Then, we can now kill the process by using this command:

kill -9 <PID>

Method 2

We can also use the command for killing all the node process, to do that enter this command:

  • killall node
  • pkill node


Leave a Comment

Your email address will not be published. Required fields are marked *