计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
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.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
When a dev server fails to start because a port is already in use, diagnose and resolve it.
Scan terminal output for these patterns:
EADDRINUSEaddress already in usePort XXXX is already in usebind: address already in useOSError: [Errno 98] Address already in useExtract the port number from the error message.
Find what's using the port:
lsof -i :<PORT> -P -n
This shows the PID, process name, and user. Common culprits:
kill <PID>
# If it doesn't stop:
kill -9 <PID>
Then restart the original server.
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 dev -p <PORT>vite --port <PORT>PORT env varpython manage.py runserver <PORT>killall node
Only suggest this if the user confirms — it kills everything.
docker pslsof shows nothing, the port may be in TIME_WAIT state — just wait 30 seconds or use a different port