mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
fix(setup.sh): add Node.js and npm version check before install
This commit is contained in:
1 parent
02d8b39d75
commit
5728209573
1 file changed
+15
@@ -19,6 +19,21 @@ echo ""
|
||||
echo "Log file: $LOG_FILE"
|
||||
echo ""
|
||||
|
||||
# ---- Check Node.js ----
|
||||
if ! command -v node &>/dev/null; then
|
||||
echo "[ERROR] Node.js not found. Please install Node.js 20+ from https://nodejs.org"
|
||||
echo " or https://nodejs.cn/ (China mirror)."
|
||||
exit 1
|
||||
fi
|
||||
echo "[OK] Node.js $(node -v)"
|
||||
|
||||
if ! command -v npm &>/dev/null; then
|
||||
echo "[ERROR] npm not found."
|
||||
exit 1
|
||||
fi
|
||||
echo "[OK] npm v$(npm -v)"
|
||||
echo ""
|
||||
|
||||
# ---- Detect China network ----
|
||||
USE_MIRROR=0
|
||||
MIRROR_REGISTRY="https://registry.npmjs.org"
|
||||
|
||||
Reference in new issue
Block a user