fix: use process.execPath for .js module spawning on all platforms @W-21984392@ - #1383
Open
WillieRuemmele wants to merge 2 commits into
Open
fix: use process.execPath for .js module spawning on all platforms @W-21984392@#1383WillieRuemmele wants to merge 2 commits into
WillieRuemmele wants to merge 2 commits into
Conversation
WillieRuemmele
force-pushed
the
wr/fixSpawnEnoentOnUnixTarballs
branch
from
August 6, 2026 15:39
f055402 to
37bdd2e
Compare
Author
Reproduction & VerificationRan the actual Before fix (old code with
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
win32platform guard inspawn.tsso.jsmodule paths are invoked via Node on all platforms, not just Windowsprocess.execPathinstead of the string'node'— ensures the bundled Node binary is used in standalone tarball deployments.jspath handling (Unix + args passthrough + paths with spaces) and non-.jspath passthroughFixes #1293
Work Item
@W-21984392@: [oclif][ISSUE]
spawnfails with ENOENT on standalone tarballs (UNIX)Bug Reproduction
The bug occurs when a
.jsfile (e.g.,npm-cli.js) has a shebang pointing to a Node interpreter that doesn't exist on the host (common in standalone tarball deployments where only the bundled node exists):On Unix,
ENOENTfromspawn()can mean "missing shebang interpreter," not just "target file missing" — which makes this error confusing to diagnose.Proof of Work
Test plan
.jsfile spawned directly.jsfile spawned viaprocess.execPathsucceeds.jspaths invoked viaprocess.execPathon Unix.jspaths with spaces in the path.jspaths remain unchangedplugins:installon standalone tarball (Linux, no system Node.js)plugins:installon Windows (paths with spaces)plugins:installwith npm-installed CLI (system node)