25 lines
553 B
Batchfile
25 lines
553 B
Batchfile
@echo off
|
||
setlocal
|
||
title Mengya Profile - Start Frontend
|
||
echo [INFO] 启动前端开发服务器...
|
||
cd /d "%~dp0mengyaprofile-frontend"
|
||
echo [INFO] 当前目录:%CD%
|
||
|
||
where npm >nul 2>nul
|
||
if errorlevel 1 (
|
||
echo [ERROR] 未检测到 npm,请先安装 Node.js(含 npm)。
|
||
exit /b 1
|
||
)
|
||
|
||
if not exist "node_modules" (
|
||
echo [INFO] 检测到缺少依赖,正在安装...
|
||
npm install --prefix "%CD%"
|
||
if errorlevel 1 (
|
||
echo [ERROR] 依赖安装失败。
|
||
exit /b 1
|
||
)
|
||
)
|
||
|
||
echo [INFO] 运行:npm start
|
||
npm start --prefix "%CD%"
|
||
endlocal |