Repository navigation
BunInstallFailedError when upgrading opencode #4047
Description
Description
I have been using opencode for quite some time now (and loving it!). When trying to upgrade to version 1.0.39 (and also just upgraded to 1.0.40), I get this error when opening opencode again. I also installed the opencode extension in my editor of choice zed.dev recently (which didn't seem to work). Maybe it's related, maybe not?
❯ opencode
Error: Unexpected error, check log file at /Users/zias/.local/share/opencode/log/2025-11-07T174508.log for more details
BunInstallFailedError: BunInstallFailedError
data: {
pkg: "opencode-copilot-auth",
version: "0.0.4",
},
at src/bun/index.ts:88:17
at processTicksAndRejections (native:7:39)
41 | code,
42 | stdout,
43 | stderr,
44 | })
45 | if (code !== 0) {
46 | throw new Error(Command failed with exit code ${result.exitCode})
^
error: Command failed with exit code 1
at run2 (src/bun/index.ts:46:13)
The logfile:
INFO 2025-11-07T17:45:08 +359ms service=default version=1.0.40 args=[] opencode
INFO 2025-11-07T17:45:08 +1ms service=project directory=/Users/zias fromDirectory
INFO 2025-11-07T17:45:08 +6ms service=config path=/Users/zias/.config/opencode/config.json loading
INFO 2025-11-07T17:45:08 +1ms service=config path=/Users/zias/.config/opencode/opencode.json loading
INFO 2025-11-07T17:45:08 +0ms service=config path=/Users/zias/.config/opencode/opencode.jsonc loading
INFO 2025-11-07T17:45:08 +1ms service=bun cmd=["/Users/zias/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.40","--exact"] cwd=/Users/zias/.config/opencode running
INFO 2025-11-07T17:45:08 +2ms service=bun cmd=["/Users/zias/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.40","--exact"] cwd=/Users/zias/.opencode running
INFO 2025-11-07T17:45:08 +22ms service=bun code=1 stdout=bun add v1.3.1 (89fa0f34)
stderr=Resolving dependencies
Resolved, downloaded and extracted [6]
error: ConnectionClosed downloading package manifest @opencode-ai/plugin
done
INFO 2025-11-07T17:45:08 +0ms service=bun code=1 stdout=bun add v1.3.1 (89fa0f34)
stderr=Resolving dependencies
Resolved, downloaded and extracted [6]
error: ConnectionClosed downloading package manifest @opencode-ai/plugin
done
INFO 2025-11-07T17:45:08 +2ms service=plugin path=opencode-copilot-auth@0.0.4 loading plugin
INFO 2025-11-07T17:45:08 +1ms service=bun pkg=opencode-copilot-auth version=0.0.4 installing package using Bun's default registry resolution
INFO 2025-11-07T17:45:08 +0ms service=bun cmd=["/Users/zias/.opencode/bin/opencode","add","--force","--exact","--cwd","/Users/zias/.cache/opencode","opencode-copilot-auth@0.0.4"] cwd=/Users/zias/.cache/opencode running
INFO 2025-11-07T17:45:08 +11ms service=bun code=1 stdout=bun add v1.3.1 (89fa0f34)
stderr=InvalidNPMLockfile: failed to migrate lockfile: 'package-lock.json'
warn: Ignoring lockfile
Resolving dependencies
Resolved, downloaded and extracted [6]
error: ConnectionClosed downloading package manifest opencode-copilot-auth
done
ERROR 2025-11-07T17:45:08 +7ms service=default pkg=opencode-copilot-auth version=0.0.4 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError
at (src/bun/index.ts:88:17)
at processTicksAndRejections (native:7:39) fatal
The error message I get from the zed.dev extension: Internal error: "server shut down unexpectedly"
The opencode help command and some others do seem to work, but trying the opencode auth login fails after selecting any provider.
I have already tried removing all opencode configuration and fully uninstalled all caches, as well as reinstalled using homebrew, npm and the curl script. All seem to give the same issue. I am on a base model MacBook Air M2 using Ghostty.
OpenCode version
1.0.40 (latest at time of writing).
Steps to reproduce
- Install zed.dev opencode extension
- Upgrade opencode to latest version
- Unable to launch opencode.
Screenshot and/or share link
No response
Operating System
MacBook Air M2
Terminal
Ghostty
Activity
github-actions commentedon Nov 7, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Nov 7, 2025
@vanneszias can you upgrade your zed extension, ill debug whatever this issue is it seems like 2 different things
vanneszias commentedon Nov 7, 2025
@rekram1-node just upgraded the zed extension to version 1.0.44. Did not make any difference to the issues seen in zed or the opencode cli.
rekram1-node commentedon Nov 7, 2025
@vanneszias my bad I think i mixed up your issue and another one.
So for yours do you have some proxy or anything that would be blocking network calls?
rekram1-node commentedon Nov 8, 2025
@jacobdalamb do u have any proxy setup? im wondering what would be causing this
vanneszias commentedon Nov 8, 2025
@rekram1-node i also thought that couldve been the issue but didnt think i had any weird network configs. i tried by switching wifi to my iphone's hotspot and manually switched to cloudflare's dns 1.1.1.1, didn't make a difference.
i just figured it out tho: i was still connected to ethernet, so switching to wifi never could've made a difference. still dont know why it didnt launch the first time using ethernet tho... propably some filter on my home network.
it's fixed! i only had to launch it once for the first time without any weird network configs, and now i can launch it even using ethernet.