fix: invoke pnpm via npm_execpath on Windows (fixes #19) - #107
fix: invoke pnpm via npm_execpath on Windows (fixes #19)#107Sainigurnoor511 wants to merge 1 commit into
Conversation
On Windows, execFileSync(pnpm, ...) fails because pnpm is a .cmd shim (ENOENT/EINVAL). Use pnpm's JS entry from npm_execpath when launched via pnpm run so argv survives intact, including paths with spaces. Fixes cloudflare#19 Co-authored-by: Cursor <cursoragent@cursor.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
I tested the exact PR head (
So the core Two current-main deltas are worth knowing before anyone rebases it:
One process caveat: the contribution-policy automation landed after this PR and now closes non-exempt external PRs over 30 changed lines on AI tools assisted the investigation. The environment, HTTP response, and spawn result above are measurements from the runs described, not predicted outcomes. |
Summary
pm_execpath\ points at pnpm's .cjs/.mjs\ entry (as under \pnpm run), run
ode ...\ so argv boundaries survive intact.
pm-cli.js\ via the path guard so
pm run\ does not silently use the wrong package manager.
esult.error\ is set (misleading wrangler error today).
Fixes #19
Approach
Follows the approach discussed in #19 / @snowyukitty's analysis: no shell, no .cmd\ shim, arguments stay intact (including checkout paths with spaces).
Test plan
CLA
I have read the CLA Document and I hereby sign the CLA