启动.bat 573 B

1234567891011121314151617181920212223
  1. @echo off
  2. chcp 65001 >nul
  3. cd /d "%~dp0"
  4. where node >nul 2>nul
  5. if errorlevel 1 (
  6. echo 未检测到 Node.js。请先安装 Node.js 22.13 或更高版本:https://nodejs.org/
  7. pause
  8. exit /b 1
  9. )
  10. node -e "const [a,b]=process.versions.node.split('.').map(Number);if(a<22||(a===22&&b<13)){console.error('当前 Node.js '+process.version+' 过低,需要 22.13 及以上。');process.exit(1)}"
  11. if errorlevel 1 (
  12. pause
  13. exit /b 1
  14. )
  15. if not exist node_modules (
  16. echo 正在安装依赖...
  17. call npm install
  18. )
  19. echo 正在启动智慧运营中台...
  20. call npm start
  21. pause