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

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 #2442
This commit is contained in:
David Marsh authored and Gustavo Madeira Santana committed 2026-01-26 20:16:40 -05:00
1 parent 1e7cb23f00
commit 1f81bbb18f
1 file changed
+1
+1
View File
@@ -99,6 +99,7 @@ export function buildParseArgv(params: {
normalizedArgv.length >= 2 &&
(executable === "node" ||
executable === "node.exe" ||
executable.startsWith("node-") ||
executable === "bun" ||
executable === "bun.exe");
if (looksLikeNode) return normalizedArgv;