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"
|
"vitest": "^2.1.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "22.x || 24.x"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"openclaw",
|
"openclaw",
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const SUPPORTED_NODE_MAJORS = [22, 24]
|
const MIN_NODE_MAJOR = 22
|
||||||
|
|
||||||
const current = process.versions.node
|
const current = process.versions.node
|
||||||
const currentMajor = Number.parseInt(current.split('.')[0] || '', 10)
|
const currentMajor = Number.parseInt(current.split('.')[0] || '', 10)
|
||||||
|
|
||||||
if (!SUPPORTED_NODE_MAJORS.includes(currentMajor)) {
|
if (currentMajor < MIN_NODE_MAJOR) {
|
||||||
const supported = SUPPORTED_NODE_MAJORS.map((major) => `${major}.x`).join(' or ')
|
|
||||||
console.error(
|
console.error(
|
||||||
[
|
[
|
||||||
`error: Mission Control supports Node ${supported}, but found ${current}.`,
|
`error: Mission Control requires Node ${MIN_NODE_MAJOR} or later, but found ${current}.`,
|
||||||
'use `nvm use 22` (recommended LTS) or `nvm use 24` before installing, building, or starting the app.',
|
'use `nvm use 22` (recommended LTS) or any later version before installing, building, or starting the app.',
|
||||||
].join('\n')
|
].join('\n')
|
||||||
)
|
)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue