fix(runtime): allow all Node versions >= 22
The version check was an allowlist of specific majors (22, 24). Changed to a >= 22 floor so future Node releases work without code changes.
This commit is contained in:
parent
d53d93351c
commit
2cada89ee9
|
|
@ -66,7 +66,7 @@
|
|||
"vitest": "^2.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "22.x || 24.x"
|
||||
"node": ">=22"
|
||||
},
|
||||
"keywords": [
|
||||
"openclaw",
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const SUPPORTED_NODE_MAJORS = [22, 24]
|
||||
const MIN_NODE_MAJOR = 22
|
||||
|
||||
const current = process.versions.node
|
||||
const currentMajor = Number.parseInt(current.split('.')[0] || '', 10)
|
||||
|
||||
if (!SUPPORTED_NODE_MAJORS.includes(currentMajor)) {
|
||||
const supported = SUPPORTED_NODE_MAJORS.map((major) => `${major}.x`).join(' or ')
|
||||
if (currentMajor < MIN_NODE_MAJOR) {
|
||||
console.error(
|
||||
[
|
||||
`error: Mission Control supports Node ${supported}, but found ${current}.`,
|
||||
'use `nvm use 22` (recommended LTS) or `nvm use 24` before installing, building, or starting the app.',
|
||||
`error: Mission Control requires Node ${MIN_NODE_MAJOR} or later, but found ${current}.`,
|
||||
'use `nvm use 22` (recommended LTS) or any later version before installing, building, or starting the app.',
|
||||
].join('\n')
|
||||
)
|
||||
process.exit(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue