From b0f717aa0294d694d2923a3cd960ab8808467458 Mon Sep 17 00:00:00 2001 From: Altay Date: Thu, 12 Mar 2026 15:26:36 +0300 Subject: [PATCH] build: align Node 22 guidance with 22.16 minimum --- docs/install/installer.md | 4 ++-- docs/platforms/mac/dev-setup.md | 2 +- scripts/install.sh | 4 ++-- src/commands/doctor-gateway-services.ts | 2 +- src/daemon/program-args.ts | 4 +++- src/daemon/runtime-paths.test.ts | 2 +- src/daemon/runtime-paths.ts | 2 +- src/daemon/service-audit.ts | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/install/installer.md b/docs/install/installer.md index 2ab4bc4a8..6317e8e06 100644 --- a/docs/install/installer.md +++ b/docs/install/installer.md @@ -251,8 +251,8 @@ Designed for environments where you want everything under a local prefix (defaul Requires PowerShell 5+. - - If missing, attempts install via winget, then Chocolatey, then Scoop. + + If missing, attempts install via winget, then Chocolatey, then Scoop. Node 22 LTS, currently `22.16+`, remains supported for compatibility. - `npm` method (default): global npm install using selected `-Tag` diff --git a/docs/platforms/mac/dev-setup.md b/docs/platforms/mac/dev-setup.md index e50a85008..982f68704 100644 --- a/docs/platforms/mac/dev-setup.md +++ b/docs/platforms/mac/dev-setup.md @@ -14,7 +14,7 @@ This guide covers the necessary steps to build and run the OpenClaw macOS applic Before building the app, ensure you have the following installed: 1. **Xcode 26.2+**: Required for Swift development. -2. **Node.js 22+ & pnpm**: Required for the gateway, CLI, and packaging scripts. +2. **Node.js 24 & pnpm**: Recommended for the gateway, CLI, and packaging scripts. Node 22 LTS, currently `22.16+`, remains supported for compatibility. ## 1. Install Dependencies diff --git a/scripts/install.sh b/scripts/install.sh index eb81d41de..ea02c48b6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1380,7 +1380,7 @@ ensure_default_node_active_shell() { echo "Then open a new shell and rerun:" echo " curl -fsSL https://openclaw.ai/install.sh | bash" else - echo "Install/select Node.js 22+ and ensure it is first on PATH, then rerun installer." + echo "Install/select Node.js ${NODE_DEFAULT_MAJOR} (or Node ${NODE_MIN_VERSION}+ minimum) and ensure it is first on PATH, then rerun installer." fi return 1 @@ -1477,7 +1477,7 @@ install_node() { fi else ui_error "Could not detect package manager" - echo "Please install Node.js 22+ manually: https://nodejs.org" + echo "Please install Node.js ${NODE_DEFAULT_MAJOR} manually (or Node ${NODE_MIN_VERSION}+ minimum): https://nodejs.org" exit 1 fi diff --git a/src/commands/doctor-gateway-services.ts b/src/commands/doctor-gateway-services.ts index 4a6d0fca8..ba9b032b4 100644 --- a/src/commands/doctor-gateway-services.ts +++ b/src/commands/doctor-gateway-services.ts @@ -257,7 +257,7 @@ export async function maybeRepairGatewayServiceConfig( note(warning, "Gateway runtime"); } note( - "System Node 22+ not found. Install via Homebrew/apt/choco and rerun doctor to migrate off Bun/version managers.", + "System Node 22 LTS (22.16+) or Node 24 not found. Install via Homebrew/apt/choco and rerun doctor to migrate off Bun/version managers.", "Gateway runtime", ); } diff --git a/src/daemon/program-args.ts b/src/daemon/program-args.ts index c92065b58..76bad8fc1 100644 --- a/src/daemon/program-args.ts +++ b/src/daemon/program-args.ts @@ -153,7 +153,9 @@ async function resolveBinaryPath(binary: string): Promise { if (binary === "bun") { throw new Error("Bun not found in PATH. Install bun: https://bun.sh"); } - throw new Error("Node not found in PATH. Install Node 22+."); + throw new Error( + "Node not found in PATH. Install Node 24 (recommended) or Node 22 LTS (22.16+).", + ); } } diff --git a/src/daemon/runtime-paths.test.ts b/src/daemon/runtime-paths.test.ts index 0483d994f..8130aa7d4 100644 --- a/src/daemon/runtime-paths.test.ts +++ b/src/daemon/runtime-paths.test.ts @@ -251,7 +251,7 @@ describe("resolveSystemNodeInfo", () => { "/Users/me/.fnm/node-22/bin/node", ); - expect(warning).toContain("below the required Node 22+"); + expect(warning).toContain("below the required Node 22.16+"); expect(warning).toContain(darwinNode); }); }); diff --git a/src/daemon/runtime-paths.ts b/src/daemon/runtime-paths.ts index a3b737d15..486ff5959 100644 --- a/src/daemon/runtime-paths.ts +++ b/src/daemon/runtime-paths.ts @@ -151,7 +151,7 @@ export function renderSystemNodeWarning( } const versionLabel = systemNode.version ?? "unknown"; const selectedLabel = selectedNodePath ? ` Using ${selectedNodePath} for the daemon.` : ""; - return `System Node ${versionLabel} at ${systemNode.path} is below the required Node 22+.${selectedLabel} Install Node 22+ from nodejs.org or Homebrew.`; + return `System Node ${versionLabel} at ${systemNode.path} is below the required Node 22.16+.${selectedLabel} Install Node 24 (recommended) or Node 22 LTS from nodejs.org or Homebrew.`; } export { resolveStableNodePath }; diff --git a/src/daemon/service-audit.ts b/src/daemon/service-audit.ts index 61f5c94f6..8524e79da 100644 --- a/src/daemon/service-audit.ts +++ b/src/daemon/service-audit.ts @@ -362,7 +362,7 @@ async function auditGatewayRuntime( issues.push({ code: SERVICE_AUDIT_CODES.gatewayRuntimeNodeSystemMissing, message: - "System Node 22+ not found; install it before migrating away from version managers.", + "System Node 22 LTS (22.16+) or Node 24 not found; install it before migrating away from version managers.", level: "recommended", }); }