From fcba8512a0d51ba3bce211e23fe2a64ff62e47d2 Mon Sep 17 00:00:00 2001 From: xucheng Date: Tue, 13 Jan 2026 18:16:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E5=89=8D=E7=AB=AF=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=94=B9=E6=88=90=203001=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 2 +- frontend/next.config.ts | 10 ++++++++++ frontend/package.json | 6 +++--- start_app.sh | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index a6df939..203d997 100755 --- a/deploy.sh +++ b/deploy.sh @@ -90,7 +90,7 @@ pm2 start ecosystem.config.js echo -e "${INFO} ==================================================" echo -e "${INFO} 部署成功!" echo -e "${INFO} 后端 API: http://localhost:8000" -echo -e "${INFO} 前端 页面: http://localhost:3000" +echo -e "${INFO} 前端 页面: http://localhost:3001" echo -e "${INFO} 使用 'pm2 list' 查看服务状态" echo -e "${INFO} 使用 'pm2 logs' 查看日志" echo -e "${INFO} ==================================================" diff --git a/frontend/next.config.ts b/frontend/next.config.ts index fa6156f..018b5ed 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -9,6 +9,16 @@ const nextConfig: NextConfig = { }, ] }, + experimental: { + turbopack: { + // Explicitly set the root to the current directory (frontend) or project root + // Since the warning says it selected the parent directory as root, but found another lockfile here. + // We can try to force it to ignore the parent one by setting root to this one? + // "root": "./" + // Actually, let's just leave it alone if I am not sure. The user just showed the log. + // It seems harmless. + } + }, }; export default nextConfig; diff --git a/frontend/package.json b/frontend/package.json index 1d2a95d..36d319e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,9 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", + "dev": "next dev -p 3001", "build": "next build", - "start": "next start", + "start": "next start -p 3001", "lint": "eslint" }, "dependencies": { @@ -42,4 +42,4 @@ "tw-animate-css": "^1.4.0", "typescript": "^5" } -} +} \ No newline at end of file diff --git a/start_app.sh b/start_app.sh index 477dd85..b1bed4c 100755 --- a/start_app.sh +++ b/start_app.sh @@ -29,13 +29,13 @@ BACKEND_PID=$! sleep 2 # 2. Start Frontend -echo "Starting Frontend (Port 3000)..." +echo "Starting Frontend (Port 3001)..." (cd frontend && npm run dev) & FRONTEND_PID=$! echo "App is running!" echo "Backend: http://localhost:8000/docs" -echo "Frontend: http://localhost:3000" +echo "Frontend: http://localhost:3001" echo "Press Ctrl+C to stop both servers." # Wait for both processes