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:
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
netstat -ano | findstr :3000
the result will be like this:
C:\Users\admin>netstat -ano | findstr :3000 TCP 0.0.0.0:3000 0.0.0.0:0 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
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
/Fhere means "force".