fix(cli): align Node 22.12 preflight checks and clean runtime guard output

Tighten installer/runtime consistency so users on Node 22.0-22.11 are blocked before install/runtime drift, with cleaner CLI guidance.

- Enforce Node >=22.12 in scripts/install.sh preflight checks
- Align installer messages to the same 22.12+ runtime floor
- Replace openclaw.mjs thrown version error with stderr+exit to avoid noisy stack traces
This commit is contained in:
Jason Hargrove
2026-03-02 17:55:59 -07:00
committed by Peter Steinberger
parent 96a38d5aa4
commit f8ed48293c
2 changed files with 37 additions and 9 deletions

View File

@@ -14,13 +14,14 @@ const ensureSupportedNodeVersion = () => {
return;
}
throw new Error(
process.stderr.write(
`openclaw: Node.js v${MIN_NODE_MAJOR}.${MIN_NODE_MINOR}+ is required (current: v${process.versions.node}).\n` +
"If you use nvm, run:\n" +
" nvm install 22\n" +
" nvm use 22\n" +
" nvm alias default 22",
" nvm alias default 22\n",
);
process.exit(1);
};
ensureSupportedNodeVersion();