windows: node.js something is already running on port 3000

created at 04-14-2022 views: 67

I met this problem during my development, this is very annoying. Since I am using windows, so here is the solution for windows user only:

windows solution

win+R and type cmd to open our terminal,

and then excute this command will help us find out the process that is occupying the 3000 port:

netstat -ano | findstr :3000

the result will be like this:

C:\Users\admin>netstat -ano | findstr :3000
  TCP               LISTENING       6124
  TCP    [::]:3000              [::]:0                 LISTENING       6124

what we need is the PID at the last column.

next step, we will kill this process with its PID:

C:\Users\admin> TASKKILL /PID 6124
ERROR: The process with PID 6124 could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).

ah oh, we have a problem, change to this

C:\Users\admin>TASKKILL /F /PID 6124
SUCCESS: The process with PID 6124 has been terminated.

we succeed! note the /F and /PID parameter.

  • parameter /F here means "force".
created at:04-14-2022
edited at: 06-02-2022: