[BUG] error: @ai-sdk/anthropic@2.0.0@latest failed to resolve when starting opencode #1847

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

Originally created by @shekohex on GitHub (Sep 26, 2025).

I've installed the latest opencode v0.11.9 and when I start it I get this error (see the logs)

INFO  2025-09-26T17:58:50 +79ms service=default version=0.11.9 args=[] opencode
INFO  2025-09-26T17:58:50 +1ms service=project directory=/home/hakim/github/shekohex/openagent fromDirectory
INFO  2025-09-26T17:58:50 +11ms service=config path=/home/hakim/.config/opencode/config.json loading
INFO  2025-09-26T17:58:50 +0ms service=config path=/home/hakim/.config/opencode/opencode.json loading
INFO  2025-09-26T17:58:50 +6ms service=config path=/home/hakim/.config/opencode/opencode.jsonc loading
INFO  2025-09-26T17:58:50 +9ms service=plugin path=file:///home/hakim/.config/opencode/plugin/notification.ts loading plugin
INFO  2025-09-26T17:58:50 +0ms service=plugin path=file:///home/hakim/.config/opencode/plugin/env.ts loading plugin
INFO  2025-09-26T17:58:50 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO  2025-09-26T17:58:50 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
INFO  2025-09-26T17:58:50 +0ms service=bun cmd=["/home/hakim/.bun/install/global/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/hakim/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/hakim/.cache/opencode running
INFO  2025-09-26T17:58:51 +752ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97)
 stderr=Resolving dependencies
Resolved, downloaded and extracted [4]
warn: incorrect peer dependency "zod@4.0.17"

warn: incorrect peer dependency "zod@4.0.17"

error: GET https://registry.npmjs.org/@ai-sdk%2fanthropic@2.0.0 - 404
error: @ai-sdk/anthropic@2.0.0@latest failed to resolve
 done
ERROR 2025-09-26T17:58:51 +4ms service=default pkg=opencode-copilot-auth version=0.0.3 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError
    at new NamedError (unknown:1:28)
    at new BunInstallFailedError (/$bunfs/root/index.js:60581:14)
    at <anonymous> (/$bunfs/root/index.js:61968:43)
    at processTicksAndRejections (native:7:39) fatal

By the way, this not an issue when I tried v0.11.2, so this issue is very recent.

Originally created by @shekohex on GitHub (Sep 26, 2025). I've installed the latest opencode v0.11.9 and when I start it I get this error (see the logs) ```log INFO 2025-09-26T17:58:50 +79ms service=default version=0.11.9 args=[] opencode INFO 2025-09-26T17:58:50 +1ms service=project directory=/home/hakim/github/shekohex/openagent fromDirectory INFO 2025-09-26T17:58:50 +11ms service=config path=/home/hakim/.config/opencode/config.json loading INFO 2025-09-26T17:58:50 +0ms service=config path=/home/hakim/.config/opencode/opencode.json loading INFO 2025-09-26T17:58:50 +6ms service=config path=/home/hakim/.config/opencode/opencode.jsonc loading INFO 2025-09-26T17:58:50 +9ms service=plugin path=file:///home/hakim/.config/opencode/plugin/notification.ts loading plugin INFO 2025-09-26T17:58:50 +0ms service=plugin path=file:///home/hakim/.config/opencode/plugin/env.ts loading plugin INFO 2025-09-26T17:58:50 +1ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-09-26T17:58:50 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution INFO 2025-09-26T17:58:50 +0ms service=bun cmd=["/home/hakim/.bun/install/global/node_modules/opencode-linux-x64/bin/opencode","add","--force","--exact","--cwd","/home/hakim/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/home/hakim/.cache/opencode running INFO 2025-09-26T17:58:51 +752ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97) stderr=Resolving dependencies Resolved, downloaded and extracted [4] warn: incorrect peer dependency "zod@4.0.17" warn: incorrect peer dependency "zod@4.0.17" error: GET https://registry.npmjs.org/@ai-sdk%2fanthropic@2.0.0 - 404 error: @ai-sdk/anthropic@2.0.0@latest failed to resolve done ERROR 2025-09-26T17:58:51 +4ms service=default pkg=opencode-copilot-auth version=0.0.3 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError at new NamedError (unknown:1:28) at new BunInstallFailedError (/$bunfs/root/index.js:60581:14) at <anonymous> (/$bunfs/root/index.js:61968:43) at processTicksAndRejections (native:7:39) fatal ``` By the way, this not an issue when I tried `v0.11.2`, so this issue is very recent.
yindo closed this issue 2026-02-16 17:32:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 26, 2025):

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

  • #2341: Reports the exact same error with opencode-copilot-auth module not found and BunInstallFailedError
  • #2765: Similar BunInstallFailedError with opencode-copilot-auth@0.0.3 after bundle.pem was deleted
  • #2224: BunInstallFailedError in airgapped environments where package resolution fails

The core issue appears to be dependency resolution failures when opencode tries to install the opencode-copilot-auth plugin, specifically when @ai-sdk/anthropic@2.0.0 cannot be resolved from the npm registry (404 error).

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

@github-actions[bot] commented on GitHub (Sep 26, 2025): This issue might be a duplicate of existing issues. Please check: - #2341: Reports the exact same error with opencode-copilot-auth module not found and BunInstallFailedError - #2765: Similar BunInstallFailedError with opencode-copilot-auth@0.0.3 after bundle.pem was deleted - #2224: BunInstallFailedError in airgapped environments where package resolution fails The core issue appears to be dependency resolution failures when opencode tries to install the opencode-copilot-auth plugin, specifically when @ai-sdk/anthropic@2.0.0 cannot be resolved from the npm registry (404 error). Feel free to ignore if none of these address your specific case.
Author
Owner

@shekohex commented on GitHub (Sep 26, 2025):

Running rm -rf ~/.cache/opencode solved the issue! Hope this helps anyone who has the same issue.

@shekohex commented on GitHub (Sep 26, 2025): Running `rm -rf ~/.cache/opencode` solved the issue! Hope this helps anyone who has the same issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1847