[PR #742] fix: add shell: true on Windows for execFileSync calls #810

Open
opened 2026-05-06 13:10:13 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/742
Author: @evil1morty
Created: 4/1/2026
Status: 🔄 Open

Base: mainHead: fix/windows-execfilesync-enoent


📝 Commits (2)

  • 5220036 fix: add shell: true on Windows for execFileSync calls
  • ae574e6 style: break long execFileSync lines to fit printWidth: 100

📊 Changes

2 files changed (+30 additions, -5 deletions)

View changed files

📝 packages/vinext/src/cli.ts (+20 -4)
📝 packages/vinext/src/deploy.ts (+10 -1)

📄 Description

Summary

vinext deploy, vinext build, and vinext lint fail on Windows with spawnSync ENOENT because execFileSync cannot execute .bin/wrangler (a shell script) or package manager commands like npm/npx (.cmd wrappers) without enabling the shell.

Error: spawnSync C:\Users\...\node_modules\.bin\wrangler ENOENT
    at runWranglerDeploy (deploy.js)

Fix

Add shell: process.platform === "win32" to all execFileSync options in deploy.ts and cli.ts. This only enables the shell on Windows where it's required, preserving the no-shell-injection guarantee on other platforms.

Affected call sites:

  • runWranglerDeploy() in deploy.ts — wrangler binary
  • installDeps() in deploy.ts — package manager
  • React upgrade in deploy() — package manager
  • React upgrade in buildApp() in cli.ts — package manager
  • lint() in cli.ts — npx eslint/oxlint

Test plan

  • Verified npx wrangler deploy works as workaround on Windows 11
  • vinext deploy on Windows with this patch
  • vinext build on Windows (react upgrade path)
  • vinext lint on Windows
  • Existing behavior on macOS/Linux unaffected (shell option is false)

Environment: Windows 11, Node 22, wrangler 4.79.0


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/742 **Author:** [@evil1morty](https://github.com/evil1morty) **Created:** 4/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-execfilesync-enoent` --- ### 📝 Commits (2) - [`5220036`](https://github.com/cloudflare/vinext/commit/5220036b6d45ffc14cfbdf82b2f0ad34c4c01923) fix: add `shell: true` on Windows for execFileSync calls - [`ae574e6`](https://github.com/cloudflare/vinext/commit/ae574e66a75a4ac05a50ac92b5aa043c6ef246ed) style: break long execFileSync lines to fit printWidth: 100 ### 📊 Changes **2 files changed** (+30 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/cli.ts` (+20 -4) 📝 `packages/vinext/src/deploy.ts` (+10 -1) </details> ### 📄 Description ## Summary `vinext deploy`, `vinext build`, and `vinext lint` fail on Windows with `spawnSync ENOENT` because `execFileSync` cannot execute `.bin/wrangler` (a shell script) or package manager commands like `npm`/`npx` (`.cmd` wrappers) without enabling the shell. ``` Error: spawnSync C:\Users\...\node_modules\.bin\wrangler ENOENT at runWranglerDeploy (deploy.js) ``` ## Fix Add `shell: process.platform === "win32"` to all `execFileSync` options in `deploy.ts` and `cli.ts`. This only enables the shell on Windows where it's required, preserving the no-shell-injection guarantee on other platforms. **Affected call sites:** - `runWranglerDeploy()` in `deploy.ts` — wrangler binary - `installDeps()` in `deploy.ts` — package manager - React upgrade in `deploy()` — package manager - React upgrade in `buildApp()` in `cli.ts` — package manager - `lint()` in `cli.ts` — npx eslint/oxlint ## Test plan - [x] Verified `npx wrangler deploy` works as workaround on Windows 11 - [x] `vinext deploy` on Windows with this patch - [x] `vinext build` on Windows (react upgrade path) - [ ] `vinext lint` on Windows - [ ] Existing behavior on macOS/Linux unaffected (shell option is `false`) **Environment:** Windows 11, Node 22, wrangler 4.79.0 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#810
No description provided.