Skip to content

BunInstallFailedError at Runtime on MacOS #3426

Closed

Description

@neshreve

Description

opencode installs successfully, my first attempt was via nix-darwin and then via brew when first met with the error. both fail in the same manner.

I suspect this won't be reproducible because (I also suspect) this is being blocked by company IT. I am hoping to learn more about the error so I can make an effective request for access.

MacBook Pro
Chip: Apple M4 Pro
Memory: 24GB
Serial No: LWV4JGTWHV
macOS: Sequoia 15.6.1
> opencode
Error: Unexpected error, check log file at /<home_dir>/.local/share/opencode/log/2025-10-24T195049.log for more details

BunInstallFailedError: BunInstallFailedError
 data: {
  pkg: "opencode-copilot-auth",
  version: "0.0.3",
},

      at src/bun/index.ts:82:17
      at processTicksAndRejections (native:7:39)

38 |       code,
39 |       stdout,
40 |       stderr,
41 |     })
42 |     if (code !== 0) {
43 |       throw new Error(`Command failed with exit code ${result.exitCode}`)
                 ^
error: Command failed with exit code 1
      at run2 (src/bun/index.ts:43:13)

OpenCode version

0.15.16

Steps to reproduce

error occurs at runtime, likely not reproducible; see description

> opencode
Error: Unexpected error, check log file at /<home_dir>/.local/share/opencode/log/2025-10-24T195049.log for more details

BunInstallFailedError: BunInstallFailedError
 data: {
  pkg: "opencode-copilot-auth",
  version: "0.0.3",
},

      at src/bun/index.ts:82:17
      at processTicksAndRejections (native:7:39)

38 |       code,
39 |       stdout,
40 |       stderr,
41 |     })
42 |     if (code !== 0) {
43 |       throw new Error(`Command failed with exit code ${result.exitCode}`)
                 ^
error: Command failed with exit code 1
      at run2 (src/bun/index.ts:43:13)

Screenshot and/or share link

No response

Operating System

macOS 15.6.1

Terminal

wezterm

Activity

  1. github-actions commented on Oct 24, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The common thread is network connectivity issues or corporate firewall restrictions preventing the download of the opencode-copilot-auth package. Since you mentioned suspecting company IT restrictions, #2992 (Windows with Cloudflare WARP) and #2224 (airgapped environment) may be most relevant.

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Contributor

    @neshreve there are some npm packages we automatically install for 2 things:

    • auth plugins to allow for copilot & anthropic oauth logins
    • provider ai sdk packages

    If you do:

    (cd ~/.cache/opencode && BUN_BE_BUN=1 opencode pm ls) it may be useful to see what you got

  3. self-assigned this
    on Oct 24, 2025
  4. neshreve commented on Oct 27, 2025

    @neshreve
    Author

    hi @rekram1-node, thank you for the advice. when I run the above command I just get error: Lockfile not found.

    I am curious if there is a way to disable the install of these modules? I work with PHI so at the end of the day we will, perhaps unfortunately, only be allowed to use amazon bedrock as our provider.

  5. rekram1-node commented on Oct 27, 2025

    @rekram1-node
    Contributor

    @neshreve You can set OPENCODE_DISABLE_DEFAULT_PLUGINS=1 and then try again it may fix your issue. It will still need to install the aws bedrock provider tho

  6. rekram1-node commented on Oct 27, 2025

    @rekram1-node
    Contributor

    Try exporting that var^ and then trying again, if it doesn't work you can try:

    rm -rf ~/.cache/opencode
    mkdir -p ~/.cache/opencode
    cd ~/.cache/opencode
    echo "{}" > package.json
    BUN_BE_BUN=1 opencode add @ai-sdk/amazon-bedrock
    
  7. neshreve commented on Oct 28, 2025

    @neshreve
    Author

    the env var let me start up opencode and the bedrock installation seems to have been successful. if I run into other issues I'll open another ticket. thanks very much for your time and assistance!

  8. rekram1-node commented on Oct 28, 2025

    @rekram1-node
    Contributor

    Yeah no problem!

  9. gcstang commented on Oct 29, 2025

    @gcstang

    @neshreve You can set OPENCODE_DISABLE_DEFAULT_PLUGINS=1 and then try again it may fix your issue. It will still need to install the aws bedrock provider tho

    This worked for me also different company :)

  10. Universal-Invariant commented on Nov 8, 2025

    @Universal-Invariant

    Similar error on windows after not using opencode for several months and then updating. It worked before. Setting OPENCODE_DISABLE_DEFAULT_PLUGINS=1 seemed to work but haven't done any further testing.

    INFO  2025-11-08T04:06:07 +61ms service=default version=0.6.4 args=[] opencode
    INFO  2025-11-08T04:06:07 +3ms service=project directory=C:\Users\User\fromDirectory
    INFO  2025-11-08T04:06:07 +4ms service=config path=C:\XDG\.config\opencode\config.json loading
    INFO  2025-11-08T04:06:07 +0ms service=config path=C:\XDG\.config\opencode\opencode.json loading
    INFO  2025-11-08T04:06:07 +0ms service=config path=C:\XDG\.config\opencode\opencode.jsonc loading
    INFO  2025-11-08T04:06:07 +2ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin
    INFO  2025-11-08T04:06:07 +1ms service=bun pkg=opencode-copilot-auth version=0.0.2 installing package using Bun's default registry resolution
    INFO  2025-11-08T04:06:07 +0ms service=bun cmd=["opencode","add","--force","--exact","--cwd","C:\\Temp\\opencode","opencode-copilot-auth@0.0.2"] cwd=C:\Temp\opencode running
    INFO  2025-11-08T04:06:07 +15ms service=bun code=1 stdout= stderr=ENOENT: Bun could not find a file, and the code that produces this error is missing a better error.
     done
    ERROR 2025-11-08T04:06:07 +1ms service=default pkg=opencode-copilot-auth version=0.0.2 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError
        at new NamedError (unknown:1:28)
        at new BunInstallFailedError (B:/~BUN/root/opencode:46373:14)
        at <anonymous> (B:/~BUN/root/opencode:68507:43)
        at processTicksAndRejections (native:7:39) fatal
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions