Repository navigation
Conversation
GUI-launched Electron still uses spawn({ shell: false }). On Windows the
official npm entry is npx.cmd (ENOENT for bare npx, EINVAL for the
shim), and fnm is often absent from the GUI PATH. Resolve npx/uvx to a
real PE binary (PATH node, then fnm/nvm/Volta) or wrap remaining .cmd
files with quoted cmd.exe so market servers can start.
fixes vastsa#789
3 tasks done
hui455
pushed a commit
to hui455/PI-Desktop
that referenced
this pull request
Sep 24, 2026
Cherry-pick PR vastsa#1012 with security fixes: - quoteWindowsCmdArg: escape % as %% so cmd.exe does not expand env vars - wrapCmdShim: wrap the /s /c line in outer quotes so paths with spaces survive cmd.exe's first/last quote stripping (prevents injection) - defaultFs.isFile: return false on statSync error instead of existsSync which could match directories - Remove bun/bunx from NODE_LAUNCHERS (dead path: bun has its own install location unrelated to node) fixes vastsa#789
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
Windows stdio MCP with
command: "npx"fails even when Node is installed:spawn({ shell: false })cannot startnpx.cmd(ENOENT / EINVAL). GUI PATH also often omits fnm.Electron main now resolves bare
npx/uvxbefore spawn:node.exefirst, then fnm / nvm-windows / Voltanode.exe+npx-cli.js(no cmd.exe).cmdshims go throughcmd.exe /d /s /cwith quoted literal argsTest plan
node --test apps/desktop/test/mcp-stdio-launch.test.mjs apps/desktop/test/plugin-mcp.test.mjs apps/desktop/test/plugin-child-env.test.mjs apps/desktop/test/user-mcp.test.mjs(72 pass after rebase)pnpm --filter @pi-desktop/desktop typechecknpx -y @modelcontextprotocol/server-memory) Test connectionfnm defaultset, same market installfixes #789