Skip to content

fix(dev): spawn turbo via shell so pnpm dev works on Windows#5

Open
scommisso wants to merge 1 commit into
ZanderAdam:mainfrom
scommisso:fix/windows-dev-spawn
Open

fix(dev): spawn turbo via shell so pnpm dev works on Windows#5
scommisso wants to merge 1 commit into
ZanderAdam:mainfrom
scommisso:fix/windows-dev-spawn

Conversation

@scommisso

Copy link
Copy Markdown
Contributor

What

Fixes pnpm dev on Windows, which currently crashes on startup:

[dev] web + client running on http://localhost:3838
Error: spawn turbo ENOENT
    syscall: 'spawn turbo', path: 'turbo', spawnargs: [ 'run', 'dev' ]

scripts/dev.mjs spawns turbo with a bare command name and an args array. On Windows the turbo binary is a turbo.cmd shim, which Node's spawn cannot exec by name without a shell, so it throws ENOENT and pnpm dev dies.

Why this fix

  • shell: true so Windows resolves the .cmd shim (POSIX still works via /bin/sh).
  • Pass the command as a single string ('turbo run dev') rather than an args array. Under shell: true an args array triggers Node's DEP0190 warning; the single-string form avoids it, and the arguments are static so there is no injection risk.

Also adds a note to .env.example: under turbo the web task runs with cwd=web/, so a relative ENGY_DIR resolves against web/ (e.g. web/.dev-engy/) rather than the repo root. Use an absolute path to point both web and client at one shared dev data store (otherwise the dev DB silently splits).

Validation

  • pnpm dev now starts cleanly on Windows 11 (Node v24): turbo 2.8.12 spawns, no ENOENT, no DEP0190 warning, web + client come up and serve requests.
  • node --check scripts/dev.mjs passes.
  • Scope is limited to the dev launcher script and an env-template comment (no app/runtime code), so the full pnpm blt suite was not run.

Notes for reviewer

  • Pre-existing (not introduced here): eslint scripts/dev.mjs reports no-undef for process/console because no Node globals are configured for the scripts/ dir. Out of scope; happy to add an eslint override in a follow-up.

🤖 Generated with Claude Code

scripts/dev.mjs spawned `turbo` with a bare command name + args array.
On Windows, Node's spawn cannot exec the `turbo.cmd` shim by name, so
`pnpm dev` crashed with `spawn turbo ENOENT`. Use shell:true and pass
the command as a single string (the single-string form avoids Node's
DEP0190 args+shell warning; the arguments are static, so there is no
injection risk).

Also document in .env.example that under turbo the web task runs with
cwd=web/, so a relative ENGY_DIR resolves against web/ rather than the
repo root -- an absolute path is needed to share one dev data store.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scommisso
scommisso marked this pull request as ready for review July 2, 2026 16:25
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