Port 4200 is already in use Angular Origin: On your device Last updated 15 Oct 2026

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

Another process is already listening on the dev-server port, often an earlier ng serve that was not stopped.

Exact message you may see Port 4200 is already in usePort 4200 is already in use. Use '--port' to specify a different portWould you like to use a different port?EADDRINUSE 4200
Seen on: Angular Angular CLI

Meaning

Only one process can use a port. Stop the old dev server, or pick another port with --port (use --port 0 for a random free one). On Linux/macOS find the process with lsof; on Windows use netstat.

Common causes

  • Previous ng serve still running in another terminal or background
  • Another app (Docker, another dev server) using 4200
  • Crashed process left a zombie
  • IDE running ng serve automatically
  • Port reserved by Windows (excluded port range)

⚡ Quick fix

  1. Run on another port: ng serve --port 4300
  2. Stop the old process
  3. Free the port with lsof / taskkill

Detailed fix by platform

Linux

  1. lsof -i :4200 then kill <PID>
  2. macOS: same commands; or npx kill-port 4200

Windows

  1. netstat -ano | findstr :4200 then taskkill /PID <pid> /F

Code examples

Find and free the port

bash
lsof -i :4200                 # shows the PID
kill -9 <PID>
ng serve --port 4300          # or pick another port

How to diagnose

  1. Process — What is listening on 4200?
  2. Terminals — Another ng serve running?
  3. Alternative — Can you use --port?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…exceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…listen EACCES — Error: listen EACCES: permission denied 0.0.0.0:80 (Node.js)listen EACCESng: command not found — Angular CLI: zsh: command not found: ng / 'ng' is not recognized as an internal or external command (Angular)ng: command not foundNode.js version detected. The Angular CLI requires a minimum — Angular CLI: Node.js version v16.20.2 detected. The Angular CLI requires a minimum Node.js version of v18.19.1 (Angular)Node.js version detec…proxy.conf.json not working — Angular CLI: [HPM] Error occurred while proxying request localhost:4200 to http://localhost:3000 [ECONNREFUSED] (Angular)proxy.conf.json not w…Repository is not clean — Angular CLI: Repository is not clean. Please commit or stash any changes before updating. (Angular)Repository is not cle…Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…Port 4200…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.