From 5e5b52142ef2ecb0921beb007638a8545c12c737 Mon Sep 17 00:00:00 2001 From: Vesylum Date: Sun, 8 Jun 2025 20:15:10 -0400 Subject: [PATCH] Check Node major version >=22 --- start.bat | 6 ++++++ start.sh | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/start.bat b/start.bat index 35c343e7a..195ba93d5 100644 --- a/start.bat +++ b/start.bat @@ -12,6 +12,12 @@ if errorlevel 1 ( exit /b ) +for /f "tokens=2 delims=v." %%i in ('node -v') do set "node_major=%%i" +if %node_major% lss 22 ( + echo Node 22 or newer is required. Detected %node_major% + exit /b +) + where /q bun if errorlevel 1 ( npm i -g bun diff --git a/start.sh b/start.sh index 37c5878ab..d8f0ed2af 100755 --- a/start.sh +++ b/start.sh @@ -6,8 +6,14 @@ if ! command -v git 2>&1 >/dev/null; then fi if ! command -v node 2>&1 >/dev/null; then - echo You must install Node to proceed - exit 1 + echo You must install Node to proceed + exit 1 +fi + +node_major=$(node --version | sed 's/^v//' | cut -d'.' -f1) +if [ "$node_major" -lt 22 ]; then + echo Node 22 or newer is required. Detected $(node --version) + exit 1 fi if ! command -v bun 2>&1 >/dev/null; then