Skip to content

Conversation

@0okay
Copy link
Contributor

@0okay 0okay commented Jan 21, 2026

This PR fixes the Windows wrapper scripts generated by npm to properly call the native Windows binary instead of failing to find /bin/sh.

Changes

  • Updated bin/agent-browser.cmd to detect architecture and directly call the agent-browser-win32-{arch}.exe binary
  • Updated bin/agent-browser shell script to properly add .exe extension for Windows binaries when running in Git Bash/MSYS environments
  • Added proper error messages when binary is not found

Problem

On Windows, running agent-browser would fail with errors like:

  • "The system cannot find the path specified"
  • "/bin/sh.exe not found"

This was because the npm-generated wrapper scripts tried to use /bin/sh which doesn't exist on standard Windows installations.

Solution

Modified the wrapper scripts to directly invoke the platform-specific native binary (agent-browser-win32-x64.exe) instead of trying to run a shell script through /bin/sh.

Testing

  • Tested on Windows 11 with PowerShell
  • Tested on Windows 11 with CMD
  • Verified binary detection and execution works correctly
  • Confirmed agent-browser command now works without errors

This commit fixes the Windows wrapper scripts generated by npm to properly
call the native Windows binary instead of failing to find /bin/sh.

Changes:
- Updated bin/agent-browser.cmd to detect architecture and directly call
  the agent-browser-win32-{arch}.exe binary
- Updated bin/agent-browser shell script to properly add .exe extension
  for Windows binaries when running in Git Bash/MSYS environments
- Added proper error messages when binary is not found

Fixes the issue where running 'agent-browser' on Windows would fail with
"The system cannot find the path specified" or "/bin/sh.exe not found"
errors.

Testing:
- Tested on Windows 11 with PowerShell
- Tested on Windows 11 with CMD
- Verified binary detection and execution works correctly
@vercel
Copy link
Contributor

vercel bot commented Jan 21, 2026

@0okay is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.


:: Detect architecture
set "ARCH=x64"
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows ARM64 architecture detection attempts to load non-existent agent-browser-win32-arm64.exe binary, causing npm install to fail on ARM64 Windows machines

Fix on Vercel

Comment on lines +7 to +9
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
if not defined PROCESSOR_ARCHITEW6432 set "ARCH=x86"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
if not defined PROCESSOR_ARCHITEW6432 set "ARCH=x86"
)
:: Note: x86 detection (32-bit Windows) is not supported as only x64 binaries are built.
:: On 32-bit systems, x64 emulation will be used (default ARCH=x64 above).

Windows 32-bit detection sets ARCH=x86 but no agent-browser-win32-x86.exe binary is built, causing npm install to fail on 32-bit Windows systems

Fix on Vercel

Comment on lines +19 to +20
echo Error: agent-browser binary not found at %BINARY% >&2
echo Run 'npm install' to download the binary, or 'npm run build:native' to build it locally. >&2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo Error: agent-browser binary not found at %BINARY% >&2
echo Run 'npm install' to download the binary, or 'npm run build:native' to build it locally. >&2
echo Error: agent-browser binary not found at %BINARY%
echo Run 'npm install' to download the binary, or 'npm run build:native' to build it locally.

Invalid stderr redirection syntax >&2 in Windows batch file that doesn't support Unix-style redirection

Fix on Vercel

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