detecting-port-conflicts
Detect EADDRINUSE and port conflicts, find what's using the port, and resolve it by killing the process or suggesting an alternative port.
How do I install this agent skill?
npx skills add https://github.com/spencerpauly/awesome-cursor-skills --skill detecting-port-conflictsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides standard diagnostic and resolution steps for port conflicts, using system utilities like lsof and kill to identify and manage processes blocking network ports. It includes appropriate warnings for high-impact actions like killing all node processes.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- ZeroLeakspass
Score: 93/100 · 2 sections analyzed
What does this agent skill do?
Detecting Port Conflicts
When a dev server fails to start because a port is already in use, diagnose and resolve it.
Detection
Scan terminal output for these patterns:
EADDRINUSEaddress already in usePort XXXX is already in usebind: address already in useOSError: [Errno 98] Address already in use
Extract the port number from the error message.
Diagnosis
Find what's using the port:
lsof -i :<PORT> -P -n
This shows the PID, process name, and user. Common culprits:
- A previous dev server that didn't shut down cleanly
- Another project's dev server
- A Docker container
- A system service
Resolution Options
Option 1: Kill the blocking process
kill <PID>
# If it doesn't stop:
kill -9 <PID>
Then restart the original server.
Option 2: Use a different port
Suggest the next available port:
# Check if port+1 is free
lsof -i :<PORT+1> -P -n
Update the dev server config or start command:
- Next.js:
next dev -p <PORT> - Vite:
vite --port <PORT> - Express: set
PORTenv var - Django:
python manage.py runserver <PORT>
Option 3: Kill all node processes (nuclear option)
killall node
Only suggest this if the user confirms — it kills everything.
Tips
- On macOS, ports below 1024 require root
- Docker containers bind ports that persist even if the container is stopped — check
docker ps - If
lsofshows nothing, the port may be in TIME_WAIT state — just wait 30 seconds or use a different port
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/spencerpauly/awesome-cursor-skills/detecting-port-conflicts">View detecting-port-conflicts on skillZs</a>