How to kill Nodejs Port
How to Kill a Node.js Port
To kill a Node.js port, you can follow these steps:
- Find the Process ID (PID) of the Node.js Process:
- Use the following command to find the PID of the process running on a specific port:
lsof -i :<port_number>
Replace
<port_number>
with the actual port number. This command will display the PID of the process using the specified port.Kill the Process Using the PID:
- Once you have the PID, use the following command to kill the process:
kill -9 <PID>
- Replace
<PID>
with the actual process ID obtained from the previous step. This command will forcefully terminate the process associated with the specified PID.
By following these steps, you can effectively kill a Node.js port.