diff --git a/src/cli/argv.test.ts b/src/cli/argv.test.ts index f5cd7720a07..25f04e80ac5 100644 --- a/src/cli/argv.test.ts +++ b/src/cli/argv.test.ts @@ -204,6 +204,18 @@ describe("argv helpers", () => { rawArgs: ["/usr/bin/node-22.2.0", "openclaw", "status"], expected: ["/usr/bin/node-22.2.0", "openclaw", "status"], }, + { + rawArgs: ["node24", "openclaw", "status"], + expected: ["node24", "openclaw", "status"], + }, + { + rawArgs: ["/usr/bin/node24", "openclaw", "status"], + expected: ["/usr/bin/node24", "openclaw", "status"], + }, + { + rawArgs: ["node24.exe", "openclaw", "status"], + expected: ["node24.exe", "openclaw", "status"], + }, { rawArgs: ["nodejs", "openclaw", "status"], expected: ["nodejs", "openclaw", "status"], diff --git a/src/cli/argv.ts b/src/cli/argv.ts index 7ab7588ae06..5229dcb19c9 100644 --- a/src/cli/argv.ts +++ b/src/cli/argv.ts @@ -172,7 +172,7 @@ export function buildParseArgv(params: { return ["node", programName || "openclaw", ...normalizedArgv]; } -const nodeExecutablePattern = /^node-\d+(?:\.\d+)*(?:\.exe)?$/; +const nodeExecutablePattern = /^node(?:-\d+|\d+)(?:\.\d+)*(?:\.exe)?$/; function isNodeExecutable(executable: string): boolean { return (