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

Viewed 101

so i have been working on a node backend project for a while now and suddnely i started encountering this error with my nodemon crashing everytime it tries to restart the app. enter image description here

The common fix for this is just to change the port and restart the server, but the problem is each time you change the port and nodemon tries to restart the app, it crashes. Another fix is to kill the process and resstart the app like so

lsof -i tcp:8000
sudo kill -9 PROCESS_ID

How ever this solution isnt long lasting as the app still crashes when nodemon tries to restart the app.

Does anyone have a better fix to this, i will really appreciayte, this errors are slowing down my development.

0 Answers
Related