Every time I save some changes to the server, nodemon fails to refresh the server with the following error:
Error: listen EADDRINUSE: address already in use :::5000
I've been using sudo lsof -i :5000
and then kill -9 [PID]
to resolve it but I've to do it every 2 mins or so.
Any permanent solution so that the server is actually killed and then restarted on refresh?