fix(app-builder): use cross-spawn for pnpm on Windows#9
Open
falkenbergo wants to merge 1 commit intocursor:mainfrom
Open
fix(app-builder): use cross-spawn for pnpm on Windows#9falkenbergo wants to merge 1 commit intocursor:mainfrom
falkenbergo wants to merge 1 commit intocursor:mainfrom
Conversation
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
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.
Problem
On Windows, spawning
pnpmwith Node's nativechild_process.spawn(pnpm, ...)could fail withspawn pnpm ENOENTwhen the app-builder server runspnpm installandpnpm exec vite ….Solution
cross-spawnfor those subprocess calls so Windows resolvespnpm.cmd/shims correctly.@types/cross-spawnas a devDependency and relaxdevProcesstyping to matchcross-spawn's returnedChildProcess; use optional chaining when piping stdout/stderr.Testing
pnpm buildsucceeds insdk/app-builder.Note
Medium Risk
Moderate risk because it changes how
pnpm installand 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.spawnusage withcross-spawnforpnpmcommands.Updates process typing (
ChildProcess) and log piping to tolerate missingstdout/stderrstreams via optional chaining, and addscross-spawnplus@types/cross-spawnto dependencies/lockfile.Reviewed by Cursor Bugbot for commit c25b941. Bugbot is set up for automated code reviews on this repo. Configure here.