1. Install lsOF

npm install -g lsof
Copy the code

2. View ports

Lsof -i TCP :8000 # lsof -i:8000Copy the code

3. End the process

Kill -9 PID # PID indicates the process that occupies the port, such as 411Copy the code