Relative Content

Tag Archive for port

Error: listen EADDRINUSE: address already in use :::5000 and answer code not working

I am building a react app and when i run app test it returns error message on terminal "Error: listen EADDRINUSE: address already in use :::5000" . I have tried to kill the process running on the port with commands "lsof -P | grep ':PortNumber' | awk '{print $2}' | xargs kill -9" and "sudo lsof -i :5000 then kill -9 PID" … however it still returns the same error on testing and when I rerun the command it shows a different process listening with a different PID. Please what I’m i not doing correctly and is there a better way to achieve this ?