The error
When you run npm start in a Create React App project, you see:
? Something is already running on port 3000.
Would you like to run the app on another port instead? (Y/n)
If you press Y, React starts on port 3001, 3002, etc. But you probably want port 3000 back.
Fix 1: portrm (instant)
$ ptrm fix 3000
Port 3000 in use
node (PID 91234) - react-scripts start
Killed PID 91234. Port 3000 is free.
$ npm start # starts on port 3000
Fix 2: Kill manually
# macOS
$ lsof -ti :3000 | xargs kill -9
# Linux
$ fuser -k 3000/tcp
# Windows
> netstat -ano | findstr :3000
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 91234
> taskkill /PID 91234 /F
Fix 3: Use a different port
Set the PORT environment variable to use a different port:
# macOS / Linux
$ PORT=3001 npm start
# Windows (PowerShell)
> $env:PORT=3001; npm start
# Or in .env file
PORT=3001
Fix 4: Disable the prompt
If you want React to always use the next available port without asking:
# .env
BROWSER=none
PORT=3000
Or set CI=true to skip the interactive prompt (useful in scripts).
Why does this keep happening?
| Cause | Fix |
|---|---|
| Old React process still running | ptrm fix 3000 or close old terminal |
| Node process crashed without cleanup | ptrm fix 3000 or kill -9 $(lsof -ti :3000) |
| Another app using port 3000 | Check with ptrm 3000 to see what is on the port |
| Backend API also on port 3000 | Move API to port 3001 or use proxy in package.json |
CRA proxy conflict
If you use proxy in package.json to forward API calls, make sure the proxy target is not also on port 3000:
// package.json
{
"proxy": "http://localhost:4000" // API on 4000, React on 3000
}
Auto-clear port in npm scripts
Add a prestart script so the port is always freed before React starts:
// package.json
{
"scripts": {
"prestart": "ptrm fix 3000",
"start": "react-scripts start"
}
}
No more "already running" prompts
portrm kills zombie React processes so you never see the port prompt again.