#3006: fix(scripts): use local pnpm binary in run-node.mjs if global is missing
scripts
Cluster:
Build and Fix Enhancements
## Summary
- Use local pnpm binary from node_modules/.bin as a fallback when global pnpm is missing
- Improves bootstrap reliability in restricted environments
## Testing
- Not run (script change only)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `scripts/run-node.mjs` to prefer a local `pnpm` binary from `node_modules/.bin` when available, improving the reliability of the TypeScript build step in environments without a global pnpm install. The change affects the “dist is stale” build path that spawns pnpm to run the configured TS compiler before running the built entrypoint.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge, but the intended pnpm fallback is currently ineffective on Windows.
- Change is small and localized to the build-spawn path, but there is a functional gap on Windows where `cmd.exe /c pnpm ...` still requires a global pnpm and ignores the computed local pnpm path; non-Windows behavior should work as intended.
- scripts/run-node.mjs (Windows spawn args)
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
82.8%
#12804: fix(daemon): use wrapper script for pnpm global installs in service...
by odinho · 2026-02-09
78.8%
#23775: fix(build): stabilize Windows script execution and Telegram monitor...
by ly85206559 · 2026-02-22
77.6%
#22425: chore: make prepare git hooks setup cross-platform
by OldFineDev · 2026-02-21
77.6%
#18493: making pnpm build:ui and pnpm build to work on windows
by darkpowerxo · 2026-02-16
77.4%
#8600: fix(update): add --ignore-scripts to prevent supply chain attacks
by yubrew · 2026-02-04
77.2%
#11432: fix(security): add --ignore-scripts to npm install in hook and plug...
by coygeek · 2026-02-07
76.7%
#9250: Fix: Add shell:true for Windows .cmd files to prevent spawn EINVAL ...
by vishaltandale00 · 2026-02-05
76.5%
#3973: fix: enhance npm package integrity checks and include critical files
by YeSuX · 2026-01-29
76.2%
#16480: fix(build): replace bash A2UI bundle script with cross-platform Typ...
by colddonkey · 2026-02-14
76.0%