Skip to content

fix: support versioned node binaries (e.g., node-22)#2444

Merged
gumadeiras merged 1 commit intoopenclaw:mainfrom
David-Marsh-Photo:fix/versioned-node-binary
Jan 27, 2026
Merged

fix: support versioned node binaries (e.g., node-22)#2444
gumadeiras merged 1 commit intoopenclaw:mainfrom
David-Marsh-Photo:fix/versioned-node-binary

Conversation

@David-Marsh-Photo
Copy link
Contributor

Summary

Fixes #2442

On Fedora (and potentially other distros), Node.js is installed with a version-suffixed binary (e.g., /usr/bin/node-22) with /usr/bin/node as a symlink. When Node resolves process.execPath, it returns the real binary path, not the symlink.

This causes buildParseArgv in src/cli/argv.ts to fail the looksLikeNode check, resulting in malformed argv that commander.js can't parse.

Changes

Added executable.startsWith("node-") to the looksLikeNode condition to handle versioned node binaries.

Testing

Tested on Fedora 43 with /usr/bin/node-22 — all CLI commands now work correctly.

Fedora and some other distros install Node.js with a version suffix
(e.g., /usr/bin/node-22) and create a symlink from /usr/bin/node.
When Node resolves process.execPath, it returns the real binary path,
not the symlink, causing buildParseArgv to fail the looksLikeNode check.

This adds executable.startsWith('node-') to handle versioned binaries.

Fixes openclaw#2442
@openclaw-barnacle openclaw-barnacle bot added the cli CLI command changes label Jan 26, 2026
@gumadeiras gumadeiras self-requested a review January 27, 2026 00:58
@gumadeiras gumadeiras merged commit c95072f into openclaw:main Jan 27, 2026
19 of 24 checks passed
@gumadeiras
Copy link
Member

Landed via rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test (after pnpm install)
  • Land commit: c95072f
  • Merge commit: c95072f

Thanks @David-Marsh-Photo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI fails on Fedora with versioned node binary (node-22)

2 participants