xxxxxxxxxx
sudo lsof -PiTCP -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
GitHub 850 grgarside 6u IPv4 0x23c345381d089301 0t0 TCP localhost:25035 (LISTEN)
How to close react port
xxxxxxxxxx
Kill all node process
killall node
Quick and easiest solution:
kill -9 $(lsof -ti:3000)
For multiple ports:
kill -9 $(lsof -ti:3000,3001)
#3000 is the port to be freed
Kill multiple ports with single line command:
xxxxxxxxxx
$ npx kill-port 3000 8080 8081
Process on port 3000 killed
Process on port 8080 killed
Process on port 8081 killed