Skip to content

fix(app-builder): use cross-spawn for pnpm on Windows#9

Open
falkenbergo wants to merge 1 commit intocursor:mainfrom
falkenbergo:fix/app-builder-cross-spawn-windows
Open

fix(app-builder): use cross-spawn for pnpm on Windows#9
falkenbergo wants to merge 1 commit intocursor:mainfrom
falkenbergo:fix/app-builder-cross-spawn-windows

Conversation

@falkenbergo
Copy link
Copy Markdown

@falkenbergo falkenbergo commented Apr 29, 2026

Problem

On Windows, spawning pnpm with Node's native child_process.spawn(pnpm, ...) could fail with spawn pnpm ENOENT when the app-builder server runs pnpm install and pnpm exec vite ….

Solution

  • Use cross-spawn for those subprocess calls so Windows resolves pnpm.cmd/shims correctly.
  • Add @types/cross-spawn as a devDependency and relax devProcess typing to match cross-spawn's returned ChildProcess; use optional chaining when piping stdout/stderr.

Testing

  • pnpm build succeeds in sdk/app-builder.

Note

Medium Risk
Moderate risk because it changes how pnpm install and the Vite dev server are spawned and how their streams are handled, which could affect session setup/startup across platforms.

Overview
Fixes Windows failures when starting app-builder sessions by replacing Node’s child_process.spawn usage with cross-spawn for pnpm commands.

Updates process typing (ChildProcess) and log piping to tolerate missing stdout/stderr streams via optional chaining, and adds cross-spawn plus @types/cross-spawn to dependencies/lockfile.

Reviewed by Cursor Bugbot for commit c25b941. Bugbot is set up for automated code reviews on this repo. Configure here.

Node's child_process.spawn failed with spawn pnpm ENOENT on Windows when
the server started pnpm install / pnpm exec vite with shell: false.

Use cross-spawn so pnpm.cmd/shims resolve reliably, and widen session
devProcess typing so log piping matches cross-spawn's ChildProcess type.

Made-with: Cursor
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.

1 participant