Friday, April 27, 2018

Tuesday, April 24, 2018

Port 4200 is already in use. Use '--port' to specify a different port.

First Option:

Open your cmd.exe as administrator,
then Find the PID of port 4200
netstat -ano | findstr :4200Pid 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

Second Option:

ng serve --open --port 4201