Skip to content

[BUG] Bun standalone crashes with ENOEXEC posix_spawn reg.exe on WSL2 #52351

Description

@johnholliday

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After updating Claude Code to version 2.1.118, Claude immediately crashes with ENOEXEC error.

What Should Happen?

Claude should launch normally.

Error Messages/Logs

❯ claude
662 |     var file = this.spawnfile = options.file, spawnargs;
663 |     if (options.args === @undefined)
664 |       spawnargs = this.spawnargs = [];
665 |     else
666 |       validateArray(options.args, "options.args"), spawnargs = this.spawnargs = options.args;
667 |       if (this.#handle = Bun.spawn({
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ^
ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'
    path: "/mnt/c/Windows/System32/reg.exe",
 syscall: "posix_spawn",
   errno: -8,
    code: "ENOEXEC"

      at spawn (node:child_process:667:35)
      at spawn (node:child_process:14:39)
      at execFile (node:child_process:59:20)
      at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:188:1452)
      at new Promise (1:11)
      at gl6 (/$bunfs/root/src/entrypoints/cli.js:188:1422)
      at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:188:1602)
      at $W$ (/$bunfs/root/src/entrypoints/cli.js:188:1822)
      at Ql6 (/$bunfs/root/src/entrypoints/cli.js:188:1861)

Bun v1.3.13 (Linux x64 baseline)

Steps to Reproduce

  1. Install v 2.1.118
  2. Run 'Claude'

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.117

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workingduplicateThis issue or pull request already existsplatform:wslIssue specifically occurs on WSL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions