Files
assist/start_frontend_portable.bat

52 lines
1016 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
echo 启动TSP智能助手前端开发服务器便携版...
echo.
set NODEJS_PATH=frontend\nodejs
set NODE_EXE=%NODEJS_PATH%\node.exe
set NPM_EXE=%NODEJS_PATH%\npm.cmd
echo 检查便携版Node.js...
if not exist "%NODE_EXE%" (
echo 错误: 未找到便携版Node.js
echo 请先运行 download_nodejs.bat 下载Node.js便携版
echo 或手动安装Node.js到系统
pause
exit /b 1
)
echo 使用便携版Node.js: %NODE_EXE%
echo Node.js版本:
"%NODE_EXE%" --version
echo.
echo 检查npm版本:
"%NPM_EXE%" --version
cd frontend
echo.
echo 检查依赖包...
if not exist "node_modules" (
echo 安装依赖包...
"%NPM_EXE%" install
if %errorlevel% neq 0 (
echo 错误: 依赖包安装失败
pause
exit /b 1
)
)
echo.
echo 启动开发服务器...
echo 前端地址: http://localhost:3000
echo 后端API: http://localhost:5000
echo WebSocket: ws://localhost:8765
echo.
echo 按 Ctrl+C 停止服务器
echo.
"%NPM_EXE%" run dev
pause