node address already in use code example
Example 1: EADDRINUSE: address already in use :::5000
sudo lsof -i :3000
Example 2: address already in use
# To see ports in use
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
Example 3: Error: listen EADDRINUSE: address already in use :::31641
ps aux | grep node //gets all the nodes and list of PID
kill -9 {PID}
Example 4: address already in use
comSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)