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
2026-01-26 15:29:32 -08:00
committed by Gustavo Madeira Santana
parent 58b96ca0c0
commit c95072fc26

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;