Skip to content

fix: bypass npm shim — resolve node.exe + invoke JS entry directly on Windows#8

Merged
damoahdominic merged 1 commit intodamoahdominic:mainfrom
ninjaa:fix/windows-powershell-path
Feb 17, 2026
Merged

fix: bypass npm shim — resolve node.exe + invoke JS entry directly on Windows#8
damoahdominic merged 1 commit intodamoahdominic:mainfrom
ninjaa:fix/windows-powershell-path

Conversation

@ninjaa
Copy link
Copy Markdown

@ninjaa ninjaa commented Feb 17, 2026

Follow-up to PR #7 (which only had the .cmd/.ps1 preference fix).

Root cause: The npm .cmd shim calls node.exe internally, but node.exe isn't on PATH inside the VS Code extension host process.

This commit adds:

  1. Dynamic node.exe discovery (Program Files, nvm-windows, volta, fnm, scoop)
  2. Direct node invocation fallback — reads the .cmd shim to extract the JS entry point, runs node.exe <openclaw.js> directly, bypassing the shim
  3. where node as last-resort discovery

…point directly

The npm .cmd/.ps1 shims fail inside the VS Code extension host because
node.exe isn't on PATH in that environment. This fix:

1. Dynamically discovers node.exe (Program Files, nvm-windows, volta, fnm, scoop)
2. Falls back to direct node invocation: reads the .cmd shim to find the
   JS entry point, then runs 'node.exe <entry.js> <args>' — bypasses
   the shim entirely
3. Adds 'where node' as last-resort node.exe discovery
@damoahdominic damoahdominic merged commit b9d4ad7 into damoahdominic:main Feb 17, 2026
4 checks passed
damoahdominic added a commit that referenced this pull request Mar 16, 2026
fix: bypass npm shim — resolve node.exe + invoke JS entry directly on Windows
damoahdominic added a commit that referenced this pull request Mar 16, 2026
fix: bypass npm shim — resolve node.exe + invoke JS entry directly on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants