listen EADDRINUSE code example

Example 1: EADDRINUSE: address already in use

sudo lsof -i :<PORT>
kill -9 <PID>

Example 2: code: 'EADDRINUSE', [0] errno: 'EADDRINUSE', [0] syscall: 'listen', [0] address: '::', [0] port: 5000

killall -9 node
//You can check if it worked with the following command
ps ax

Example 3: Error: listen EADDRINUSE: address already in use :::3000

C:\Windows\System32>taskkill /F /IM node.exe
SUCCESS: The process "node.exe" with PID 11008 has been terminated.

Example 4: 'EADDRINUSE'

sudo lsof -i :3000
kill -9 {PID}