killing a port on macos

You can find out what is running on a specific port by running the command lsof -i with the port number, :<PortNumber>.

01sudo lsof -i :<PortNumber>
02
03kill -9 <PID>

Or you can kill al processes with the following command:

01killall node