Did you mean to visit localhost:4200?

Did you mean to visit: http://localhost:4200/?

💡 Pro Tip: Port 4200 is Angular's default development port. If it's busy, Angular CLI will automatically suggest the next available port like 4201.

Quick Commands for Port 4200

Find what's using port 4200:
lsof -i :4200 (Mac/Linux)
netstat -ano | findstr :4200 (Windows)
Start Angular on different port:
ng serve --port 4201
npm start -- --port 4201

About Port 4200

Port 4200 is commonly used by:

Common Issues with Port 4200

"Port 4200 is already in use"

This error occurs when another application is already using port 4200. Solutions:

  • Find and close the application using port 4200
  • Use a different port:
    • Angular CLI: ng serve --port 4201
    • In angular.json: Set "port": 4201 in the serve options
  • On Windows, find and kill the process: netstat -ano | findstr :4200 then taskkill /PID [PID] /F
  • On Linux/Mac: lsof -i :4200 then kill -9 [PID]

"Cannot access localhost:4200 from other devices"

By default, Angular's development server only listens on localhost:

  • To make it accessible from other devices on your network: ng serve --host 0.0.0.0
  • Then access it using your computer's IP address: http://YOUR_IP:4200

"Changes not reflecting in the browser"

If your code changes aren't showing up:

  • Check if the Angular development server is running with hot reload enabled
  • Try clearing your browser cache
  • Restart the development server with ng serve
  • Check for errors in the terminal or browser console

Useful Resources