claude-code - 💡(How to fix) Fix [BUG] Bun standalone crashes with ENOEXEC posix_spawn reg.exe on WSL2 [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52351Fetched 2026-04-24 06:09:29
View on GitHub
Comments
2
Participants
3
Timeline
12
Reactions
0
Timeline (top)
labeled ×4cross-referenced ×3commented ×2closed ×1

Error Message

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

Error Messages/Logs

ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'

Code Example

❯ 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)
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

The issue is likely due to an incompatibility between the updated Claude Code version and the WSL environment, causing an ENOEXEC error when trying to spawn a process.

Guidance

  • The error message indicates a problem with posix_spawn and an unknown error, suggesting an issue with the execution of the reg.exe file.
  • The fact that this worked in a previous version (2.1.117) and not in the current version (2.1.118) suggests a regression bug.
  • Try downgrading to version 2.1.117 to verify if the issue is specific to the latest version.
  • Investigate potential differences in system calls or dependencies between the two versions that could be causing the incompatibility.

Example

No code snippet is provided as the issue seems to be related to a specific version and environment.

Notes

The issue might be specific to the WSL environment on Windows, and testing on a native Linux system could help determine if the problem is environment-specific.

Recommendation

Apply workaround: Downgrade to version 2.1.117 until the issue is resolved in a future version, as it is confirmed to work in that version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING