BunInstallFailedError at Runtime on MacOS #2271

Closed
opened 2026-02-16 17:34:55 -05:00 by yindo · 9 comments
Owner

Originally created by @neshreve on GitHub (Oct 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @neshreve on GitHub (Oct 24, 2025). Originally assigned to: @rekram1-node on GitHub. ### 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
yindo added the bug label 2026-02-16 17:34:55 -05:00
yindo closed this issue 2026-02-16 17:34:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2025):

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

  • #2992: Similar BunInstallFailedError with opencode-copilot-auth package failing due to network/certificate issues
  • #3138: BunInstallFailedError with JSON syntax errors during package resolution
  • #2341: Cannot find opencode-copilot-auth module errors
  • #3350: Similar module not found errors for opencode-copilot-auth
  • #2224: BunInstallFailedError in restricted network environments (airgapped)
  • #2765: BunInstallFailedError due to missing certificate files

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.

@github-actions[bot] commented on GitHub (Oct 24, 2025): This issue might be a duplicate of existing issues. Please check: - #2992: Similar BunInstallFailedError with opencode-copilot-auth package failing due to network/certificate issues - #3138: BunInstallFailedError with JSON syntax errors during package resolution - #2341: Cannot find opencode-copilot-auth module errors - #3350: Similar module not found errors for opencode-copilot-auth - #2224: BunInstallFailedError in restricted network environments (airgapped) - #2765: BunInstallFailedError due to missing certificate files 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.
Author
Owner

@rekram1-node commented on GitHub (Oct 24, 2025):

@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

@rekram1-node commented on GitHub (Oct 24, 2025): @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
Author
Owner

@neshreve commented on GitHub (Oct 27, 2025):

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.

@neshreve commented on GitHub (Oct 27, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Oct 27, 2025):

@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

@rekram1-node commented on GitHub (Oct 27, 2025): @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
Author
Owner

@rekram1-node commented on GitHub (Oct 27, 2025):

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
@rekram1-node commented on GitHub (Oct 27, 2025): 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 ```
Author
Owner

@neshreve commented on GitHub (Oct 28, 2025):

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!

@neshreve commented on GitHub (Oct 28, 2025): 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!
Author
Owner

@rekram1-node commented on GitHub (Oct 28, 2025):

Yeah no problem!

@rekram1-node commented on GitHub (Oct 28, 2025): Yeah no problem!
Author
Owner

@gcstang commented on GitHub (Oct 29, 2025):

@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 :)

@gcstang commented on GitHub (Oct 29, 2025): > [@neshreve](https://github.com/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 :)
Author
Owner

@Universal-Invariant commented on GitHub (Nov 7, 2025):

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
@Universal-Invariant commented on GitHub (Nov 7, 2025): 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2271