Port 4200 is already in use” when running the ng serve command - cSharp Coder

Latest

cSharp Coder

Sharp Future

Friday, November 8, 2019

Port 4200 is already in use” when running the ng serve command

Open your cmd.exe as administrator,
then Find the PID of port 4200
netstat -ano | findstr :4200
Pid for port 4200
Here i have 3 PID :
  • Red one is from "ng-serve" (127.0.0.1:4200) that LISTENING
  • Green one is from "your browser"
kill only port 4200 (kill the red PID):
taskkill /PID 15940 /F
note : kill the green one will only lead your browser closed by force.
taskkill pid 15940
now you can do "ng-serve" to start your angular app at the same port 4200

No comments:

Post a Comment