fix(install): install Node 20 on Linux; Vite needs it

Debian apt ships EOL Node 18 which crashes Vite 8. Prep stage installs Node 20
from NodeSource when node is missing or <20; package.json declares engines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jon
2026-07-23 16:18:35 -05:00
co-authored by Claude Opus 4.8
parent 5921d6626a
commit accf645a42
2 changed files with 15 additions and 1 deletions
+12 -1
View File
@@ -35,8 +35,19 @@ if [ "$stage" = "prep" ]; then
echo "Installing system packages..."
sudo apt-get install -y --no-install-recommends \
git sqlite3 curl python3-venv python3-gi gir1.2-gtk-3.0 \
nodejs npm xfce4-genmon-plugin plank blueman \
xfce4-genmon-plugin plank blueman \
|| echo "Warning: some system packages failed — install them manually."
# Node.js 20+: Vite needs 20.19+, but Debian/Ubuntu apt ship an EOL Node 18
# (its 'nodejs' package) which crashes Vite with 'CustomEvent is not defined'.
# Install from NodeSource only when the current node is missing or too old.
node_major=$(node -v 2>/dev/null | sed -E 's/^v([0-9]+).*/\1/')
if [ -z "$node_major" ] || [ "$node_major" -lt 20 ]; then
echo "Installing Node.js 20 (found: ${node_major:-none})..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - \
&& sudo apt-get install -y nodejs \
|| echo "Warning: Node 20 install failed — install Node 20+ manually (Vite needs it)."
fi
fi
exit 0
fi