fix: add service management scripts for port conflicts

New tools:
- 鍋滄鎵€鏈夋湇鍔?bat - Stop all services
- 鏌ョ湅绔彛鍗犵敤.bat - Check port usage
- 閲嶅惎鏈嶅姟.bat - Restart services
- 蹇€熶慨澶?绔彛鍗犵敤.md - Troubleshooting guide

These scripts help resolve:
- EADDRINUSE error (port 3001 already in use)
- ENOBUFS error (network connection issues)
- Timeout errors (backend not responding)
This commit is contained in:
AI Clinical Dev Team
2025-10-10 21:23:51 +08:00
parent cc3323b795
commit 16b975c340
4 changed files with 373 additions and 0 deletions

56
停止所有服务.bat Normal file
View File

@@ -0,0 +1,56 @@
@echo off
chcp 65001 >nul
echo ========================================
echo 停止所有服务
echo ========================================
echo.
echo [1] 查找占用3001端口的进程...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr :3001') do (
set PID=%%a
echo 找到进程: PID=%%a
taskkill /F /PID %%a >nul 2>&1
if errorlevel 1 (
echo ❌ 无法终止进程 %%a
) else (
echo ✅ 已终止进程 %%a
)
)
echo.
echo [2] 查找占用3000端口的进程...
for /f "tokens=5" %%a in ('netstat -aon ^| findstr :3000') do (
set PID=%%a
echo 找到进程: PID=%%a
taskkill /F /PID %%a >nul 2>&1
if errorlevel 1 (
echo ❌ 无法终止进程 %%a
) else (
echo ✅ 已终止进程 %%a
)
)
echo.
echo [3] 查找Node进程...
tasklist | findstr node.exe >nul
if not errorlevel 1 (
echo 找到Node进程正在终止...
taskkill /F /IM node.exe >nul 2>&1
if errorlevel 1 (
echo ❌ 无法终止Node进程
) else (
echo ✅ 已终止所有Node进程
)
) else (
echo 没有运行中的Node进程
)
echo.
echo ========================================
echo 清理完成
echo ========================================
echo.
echo 现在可以重新启动服务了
echo.
pause