| 12345678910111213141516 |
- #!/bin/bash
- cd "$(dirname "$0")" || exit 1
- # Node.js >= 22.13(内置 SQLite 驱动 node:sqlite 不再需要 flag)
- if ! command -v node >/dev/null 2>&1; then
- echo "未检测到 Node.js。请先安装 Node.js 22.13 或更高版本:https://nodejs.org/"
- exit 1
- fi
- 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)}" || exit 1
- if [ ! -d node_modules ]; then
- echo "正在安装依赖..."
- npm install || exit 1
- fi
- echo "正在启动智慧运营中台..."
- npm start
|