opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Can't open opencode after install

Open chouzz opened this issue 1 month ago • 15 comments

Description

Seems opencode does not work well in the company network, after installing opencode via npm, it can't be opened.

PS D:\src\github-src\claude-code-inspector> npm i -g opencode-ai@latest

added 3 packages in 15s
PS D:\src\github-src\claude-code-check> opencode
{
  "name": "BunInstallFailedError",
  "data": {
    "pkg": "opencode-copilot-auth",
    "version": "0.0.8"
  }
}

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows terminal

chouzz avatar Dec 08 '25 03:12 chouzz

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

  • #2992: opencode fails to start after chocolatey install: HTTPThread: the CA is invalid
  • #3130: SSL_CERT_FILE env not observed since v0.15.0
  • #3566: error: SELF_SIGNED_CERT_IN_CHAIN
  • #3426: BunInstallFailedError at Runtime on MacOS (company network environment)
  • #3989: acp-command unhandled rejection (company proxy issues)

All of these involve BunInstallFailedError occurring when trying to install plugins in network-restricted environments (corporate proxies, firewalls, etc.). The core issue appears to be that OpenCode cannot properly download and install the opencode-copilot-auth plugin due to network/certificate restrictions.

Feel free to ignore if your specific case differs from these existing reports.

github-actions[bot] avatar Dec 08 '25 03:12 github-actions[bot]

@chouzz set: OPENCODE_DISABLE_DEFAULT_PLUGINS=true and then try again

rekram1-node avatar Dec 08 '25 03:12 rekram1-node

Hi, @rekram1-node! I have same issue. Could you clarify how should I set OPENCODE_DISABLE_DEFAULT_PLUGINS=false? As env variable?

Tako-San avatar Dec 08 '25 08:12 Tako-San

This does not help:

❯ OPENCODE_DISABLE_DEFAULT_PLUGINS=false opencode
{
  "name": "BunInstallFailedError",
  "data": {
    "pkg": "opencode-copilot-auth",
    "version": "0.0.8"
  }
}

daliusd avatar Dec 08 '25 10:12 daliusd

You will want OPENCODE_DISABLE_DEFAULT_PLUGINS=1 opencode similar issue here https://github.com/sst/opencode/issues/3426

adanperez avatar Dec 08 '25 22:12 adanperez

Whoops I meant to say true (1 works too ofc)

rekram1-node avatar Dec 08 '25 22:12 rekram1-node

I was tired my bad

rekram1-node avatar Dec 08 '25 22:12 rekram1-node

You will want OPENCODE_DISABLE_DEFAULT_PLUGINS=1 opencode similar issue here #3426

Works good for me.

chouzz avatar Dec 09 '25 09:12 chouzz

This works but it errors out with externel plugins as well. Meaning using OPENCODE_DISABLE_DEFAULT_PLUGINS=1 opencode with the following configuration snippet will still cause it to fail.

...
  "plugin": ["opencode-openai-codex-auth@@4.0.2", "opencode-gemini-auth"],
...

Removing the plugins fixes it but then you loose access to the plugins.

PatNei avatar Dec 10 '25 14:12 PatNei

Upgrading to newer OpenCode versions solved the problem for me. Note: in my case it was not fresh install

daliusd avatar Dec 10 '25 14:12 daliusd

I see, I tried updating to version 1.0.143. Still having the issue.

UPDATE: I could fix it by removing a root level .npmrc file.

Longer explanation:

Tried bun add --force --exact --cwd ~/.cache/opencode [email protected], which gave me

$ bun add --force --exact --cwd ~/.cache/opencode [email protected]
bun add v1.3.2 (b131639c)
error: ConnectionRefused downloading package manifest opencode-copilot-auth

Which led me to a similar issue here: https://github.com/oven-sh/bun/issues/4988#issuecomment-2660869480

I didn't try the IPV6 fix but it might also help :)

PatNei avatar Dec 10 '25 14:12 PatNei