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

后端 未结 30 1388
深忆病人
深忆病人 2020-12-02 03:47

I am learning angular 2 and for the first time I am using the angular CLI project to create a sandbox project.

I was able to run the command \"ng serve\" and it wor

相关标签:
30条回答
  • 2020-12-02 04:03

    It says already we are running the services with port no 4200 please use another port instead of 4200. Below command is to solve the problem

    ng serve --port 4300

    0 讨论(0)
  • 2020-12-02 04:04

    On linux mint 17, this is working.

    kill -9 $(lsof -t -i:4200)

    0 讨论(0)
  • 2020-12-02 04:05

    ng serve --port <YOUR_GIVEN_PORT_NUMBER>

    You should try above command to run on your given port.

    0 讨论(0)
  • 2020-12-02 04:05

    The most simple one line command:

     sudo fuser -k 4200/tcp
    
    0 讨论(0)
  • 2020-12-02 04:05

    You can also try with this to run your application in visual studio code -:

    ng serve --open --port 4201
    

    you can give any port number.

    0 讨论(0)
  • 2020-12-02 04:06

    To stop all the local port running in windows, use this simple comment alone instead searching for pid separatly using netstat,

    It find all the pid and stop the local port which is currently running,

    taskkill /im node.exe /f
    
    0 讨论(0)
提交回复
热议问题