Skip to content

opencode-copilot-auth error #2341

Closed
Closed

Description

@Lain-droid

INFO 2025-08-31T09:51:23 +323ms service=default version=0.5.29 args=[] opencode
INFO 2025-08-31T09:51:23 +1ms service=app cwd=/root creating
INFO 2025-08-31T09:51:23 +21ms service=app git
INFO 2025-08-31T09:51:23 +40ms service=app name=plugin registering service
INFO 2025-08-31T09:51:23 +2ms service=app name=config registering service
INFO 2025-08-31T09:51:23 +20ms service=config path=/root/.config/opencode/config.json loading
INFO 2025-08-31T09:51:23 +15ms service=config path=/root/.config/opencode/opencode.json loading
INFO 2025-08-31T09:51:23 +1ms service=config path=/root/.config/opencode/opencode.jsonc loading
INFO 2025-08-31T09:51:23 +49ms service=config agent={} mode={} command={} plugin=[] username=root loaded
INFO 2025-08-31T09:51:23 +0ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin
ERROR 2025-08-31T09:51:23 +41ms service=default name=ResolveMessage message=Cannot find module '/root/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/opencode' code=ERR_MODULE_NOT_FOUND specifier=/root/.cache/opencode/node_modules/opencode-copilot-auth referrer=/$bunfs/root/opencode importKind=import-statement fatal

I tryed to install opencode-copilot-auth with bun but don't worked also I'm tryed reinstall several times it don't work too

Activity

  1. github-actions commented on Aug 31, 2025

    @github-actions
    Contributor

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

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

  2. Lain-droid commented on Aug 31, 2025

    @Lain-droid
    Author

    INFO 2025-08-31T11:30:58 +422ms service=default version=0.5.29 args=[] opencode
    INFO 2025-08-31T11:30:58 +2ms service=app cwd=/root creating
    INFO 2025-08-31T11:30:58 +13ms service=app git
    INFO 2025-08-31T11:30:58 +4ms service=app name=plugin registering service
    INFO 2025-08-31T11:30:58 +3ms service=app name=config registering service
    INFO 2025-08-31T11:30:58 +6ms service=config path=/root/.config/opencode/config.json loading
    INFO 2025-08-31T11:30:58 +2ms service=config path=/root/.config/opencode/opencode.json loading
    INFO 2025-08-31T11:30:58 +11ms service=config path=/root/.config/opencode/opencode.jsonc loading
    INFO 2025-08-31T11:30:58 +135ms service=config agent={} mode={} command={} plugin=[] username=root loaded
    INFO 2025-08-31T11:30:58 +0ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin
    INFO 2025-08-31T11:30:58 +1ms service=bun pkg=opencode-copilot-auth version=0.0.2 installing package using Bun's default registry resolution
    INFO 2025-08-31T11:30:58 +1ms service=bun cmd=["/root/.opencode/bin/opencode","add","--force","--exact","--cwd","/root/.cache/opencode","opencode-copilot-auth@0.0.2"] cwd=/root/.cache/opencode running
    INFO 2025-08-31T11:30:59 +580ms service=bun code=0 stdout=bun add v1.2.19 (aad3abea)

    • opencode-anthropic-auth@0.0.2

    installed opencode-copilot-auth@0.0.2

    14 packages installed [465.00ms]
    stderr=Saved lockfile
    done
    ERROR 2025-08-31T11:30:59 +20ms service=default name=ResolveMessage message=Cannot find module '/root/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/opencode' code=ERR_MODULE_NOT_FOUND specifier=/root/.cache/opencode/node_modules/opencode-copilot-auth referrer=/$bunfs/root/opencode importKind=import-statement fatal
    root@localhost:~#

  3. rekram1-node commented on Aug 31, 2025

    @rekram1-node
    Contributor

    what happens if you do:

    rm -rf ~/.cache/opencode

    and then try again

  4. pulpo commented on Aug 31, 2025

    @pulpo

    @Lain-droid same issue here, in a proot environment under termux...

  5. Lain-droid commented on Sep 1, 2025

    @Lain-droid
    Author

    Yeah its proot too

  6. pulpo commented on Sep 1, 2025

    @pulpo

    I tried with the latest version (0.6.0), also deleting the .cache/opencode, an the problem is still present.

  7. rekram1-node commented on Sep 1, 2025

    @rekram1-node
    Contributor

    I mentioned this to Dax yesterday so I think he is looking into it

  8. HavardPede commented on Sep 4, 2025

    @HavardPede

    Im also encountering this issue, on version 0.6.4

  9. fkukuck commented on Sep 8, 2025

    @fkukuck
    Contributor

    Does this mean you cannot authenticate with GitHub at the moment? Can you confirm? I'm scared to update opencode since I use it with GitHub

  10. rekram1-node commented on Sep 8, 2025

    @rekram1-node
    Contributor

    no it doesnt mean you can’t authenticate it just means occasionally an error will happen and you may have to send a message twice until Dax fixes it, when I say twice I dont mean literally type it out twice itd be more like:

    • send message
    • api error
    • send “.”
      works
  11. supastishn commented on Sep 13, 2025

    @supastishn

    INFO 2025-09-13T19:26:28 +907ms service=default version=0.7.9 args=["auth","login"] opencode INFO 2025-09-13T19:26:28 +1ms service=project directory=/home/supastishn fromDirectory INFO 2025-09-13T19:26:28 +168ms service=models.dev file={} refreshing INFO 2025-09-13T19:26:28 +520ms service=models.dev file
    ={} refreshing INFO 2025-09-13T19:26:46 +17593ms service=config path=/home/supastishn/.config/opencode/config.json loading INFO 2025-09-13T19:26:46 +2ms service=config path=/home/supastishn/.config/opencode/opencode.json loading INFO 2025-09-13T19:26:46 +2ms service=config path=/home/supastishn/.config/opencode/opencode.jsonc loading INFO 2025-09-13T19:26:46 +123ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin INFO 2025-09-13T19:26:46 +22ms service=bun pkg=opencode-copilot-auth version=0.0.2 installing package using Bun's default registry resolution INFO 2025-09-13T19:26:46 +5ms service=bun cmd=["/home/supastishn/node_modules/opencode-linux-arm64/bin/opencode","add","--force","--exact","--cwd","/home/supastishn/.cache/opencode","opencode-copilot-auth@0.0.2"] cwd=/home/supastishn/.cache/opencode running INFO 2025-09-13T19:26:46 +131ms service=bun code=0 stdout=bun add v1.2.21 (7c45ed97) installed opencode-copilot-auth@0.0.2

    1 package installed [51.00ms]
    stderr=Saved lockfile
    done
    ERROR 2025-09-13T19:26:46 +8ms service=default name=Reso
    lveMessage message=Cannot find module '/home/supastishn/
    .cache/opencode/node_modules/opencode-copilot-auth' from
    '/$bunfs/root/index.js' code=ERR_MODULE_NOT_FOUND speci
    fier=/home/supastishn/.cache/opencode/node_modules/openc
    ode-copilot-auth referrer=/$bunfs/root/index.js importKi
    nd=import-statement fatal

    im getting the error when i run opencode auth login, even without using github copilot provider. tried deleting cache to no svsil

  12. rekram1-node commented on Sep 13, 2025

    @rekram1-node
    Contributor

    @supastishn what do u see if you run:

    (cd ~/.cache/opencode && BUN_BE_BUN=1 opencode pm ls)
    
  13. yungchinghsiao commented on Oct 18, 2025

    @yungchinghsiao

    I just resolved a similar module-not-found error by deleting everything and reinstall using npm. Reinstall using bun from scratch does not resolve the error. I suspect it this might have to do with mixup of npm and bun - but i am not familiar with both so this is a pure speculation. I am behind a coporate proxy and bun's support of proxy does not seem to work consistently (It hangs installing missing modules reported by opencode). I suspect that might be the culprit (oven-sh/bun#1440).

  14. gabrieldebem commented on Oct 20, 2025

    @gabrieldebem

    im having a similar error here in my 15.5 macos

    ~/.cache/opencode > npm i @ai-sdk/anthropic@beta                                                                                                                                                                                                                        took 5s at 11:41:07
    ⠙(node:68885) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
    (Use `node --trace-warnings ...` to show where the warning was created)
    
    added 7 packages in 17s
    
    1 package is looking for funding
      run `npm fund` for details
    ~/.cache/opencode > (cd ~/.cache/opencode && BUN_BE_BUN=1 opencode pm ls)                                                                                                                                                                                              took 18s at 11:41:30
    [3.92ms] migrated lockfile from package-lock.json
    /Users/gabriel.bem/.cache/opencode node_modules (7)
    └── @ai-sdk/anthropic@3.0.0-beta.32
    ~/.cache/opencode > opencode auth login                                                                                                                                                                                                                                         at 11:41:37
    
    ┌  Add credential
    │
    ◇  Select provider
    │  GitHub Copilot
    Error: Unexpected error, check log file at /Users/gabriel.bem/.local/share/opencode/log/2025-10-20T144142.log for more details
    ~/.cache/opencode > cat /Users/gabriel.bem/.local/share/opencode/log/2025-10-20T144142.log                                                                                                                                                                              took 3s at 11:41:45
    INFO  2025-10-20T14:41:42 +70ms service=default version=0.15.8 args=["auth","login"] opencode
    INFO  2025-10-20T14:41:42 +0ms service=project directory=/Users/gabriel.bem/.cache/opencode fromDirectory
    INFO  2025-10-20T14:41:42 +5ms service=models.dev file={} refreshing
    INFO  2025-10-20T14:41:42 +308ms service=models.dev file={} refreshing
    INFO  2025-10-20T14:41:43 +1141ms service=config path=/Users/gabriel.bem/.config/opencode/config.json loading
    INFO  2025-10-20T14:41:43 +0ms service=config path=/Users/gabriel.bem/.config/opencode/opencode.json loading
    INFO  2025-10-20T14:41:43 +1ms service=config path=/Users/gabriel.bem/.config/opencode/opencode.jsonc loading
    INFO  2025-10-20T14:41:43 +4ms service=bun cmd=["/opt/homebrew/Cellar/opencode/0.15.8/libexec/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@0.15.8","--exact"] cwd=/Users/gabriel.bem/.config/opencode running
    INFO  2025-10-20T14:41:43 +4ms service=bun cmd=["/opt/homebrew/Cellar/opencode/0.15.8/libexec/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@0.15.8","--exact"] cwd=/Users/gabriel.bem/.opencode running
    INFO  2025-10-20T14:41:43 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
    INFO  2025-10-20T14:41:43 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
    INFO  2025-10-20T14:41:43 +0ms service=bun cmd=["/opt/homebrew/Cellar/opencode/0.15.8/libexec/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode","add","--force","--exact","--cwd","/Users/gabriel.bem/.cache/opencode","opencode-copilot-auth@0.0.3"] cwd=/Users/gabriel.bem/.cache/opencode running
    INFO  2025-10-20T14:41:44 +902ms service=bun code=1 stdout=bun add v1.3.0 (b0a6feca)
     stderr=Resolving dependencies
    Resolved, downloaded and extracted [1]
    error: GET https://npm.pkg.github.com/@opencode-ai%2fplugin - 404
     done
    ERROR 2025-10-20T14:41:44 +0ms service=default e=Command failed with exit code 1 rejection
    INFO  2025-10-20T14:41:44 +16ms service=bun code=1 stdout=bun add v1.3.0 (b0a6feca)
     stderr=[0.16ms] migrated lockfile from package-lock.json
    Resolving dependencies
    Resolved, downloaded and extracted [1]
    error: GET https://npm.pkg.github.com/opencode-copilot-auth - 404
     done
    ERROR 2025-10-20T14:41:44 +15ms 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 <anonymous> (/$bunfs/root/index.js:68596:43)
        at processTicksAndRejections (native:7:39) fatal
    INFO  2025-10-20T14:41:45 +780ms service=bun code=1 stdout=bun add v1.3.0 (b0a6feca)
     stderr=Resolving dependencies
    Resolved, downloaded and extracted [1]
    error: GET https://npm.pkg.github.com/@opencode-ai%2fplugin - 404
     done
    ERROR 2025-10-20T14:41:45 +0ms service=default e=Command failed with exit code 1 rejection
    

    I’m getting a similar error on macOS 15.5 — looks like
    GET https://npm.pkg.github.com/opencode-copilot-auth
    doesn’t exist (404).

  15. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Contributor

    @gabrieldebem can you do:

    rm -rf ~/.cache/opencode

    then run:

    opencode run hello --print-logs

  16. 621625 commented on Oct 22, 2025

    @621625

    @gabrieldebem can you do:

    rm -rf ~/.cache/opencode

    then run:

    opencode run hello --print-logs

    Hi rekram1-node,

    Hope you are well.

    Same issue. Your input gives:

    [root@localhost ~]# rm -rf ~/.cache/opencode [root@localhost ~]# opencode run hello --print-logs INFO 2025-10-22T08:30:00 +23481ms service=default version=0.1
    5.13 args=["run","hello","--print-logs"] opencode INFO 2025-10-22T08:30:00 +5ms service=project directory=/root fromDirectory INFO 2025-10-22T08:30:00 +159ms service=config path=/root/.config/opencode/config.json loading INFO 2025-10-22T08:30:00 +11ms service=config path=/root/.config/opencode/opencode.json loading INFO 2025-10-22T08:30:00 +1ms service=config path=/root/.config/opencode/opencode.jsonc loading INFO 2025-10-22T08:30:00 +23ms service=bun cmd=["/root/.openc
    ode/bin/opencode","add","@opencode-ai/plugin@0.15.13","--exact
    "] cwd=/root/.config/opencode running
    INFO 2025-10-22T08:30:00 +43ms service=bun cmd=["/root/.openc
    ode/bin/opencode","add","@opencode-ai/plugin@0.15.13","--exact
    "] cwd=/root/.opencode running
    INFO 2025-10-22T08:30:00 +58ms service=bun code=1 stdout=bun add v1.3.0 (b0a6feca) installed @opencode-ai/plugin@0.15.13 Failed to install 1 package
    [65.00ms] done
    stderr=FileNotFound: failed copying files from cache to desti
    nation for package @opencode-ai/sdk Saved lockfile
    done ERROR 2025-10-22T08:30:00 +0ms service=default e=Command faile
    d with exit code 1 rejection
    INFO 2025-10-22T08:30:01 +275ms service=plugin path=opencode-
    copilot-auth@0.0.3 loading plugin
    INFO 2025-10-22T08:30:01 +11ms service=bun pkg=opencode-copil
    ot-auth version=0.0.3 installing package using Bun's default r
    egistry resolution
    INFO 2025-10-22T08:30:01 +1ms service=bun cmd=["/root/.openc

    ode/bin/opencode","add","@opencode-ai/plugin@0.15.13","--exact"] cwd=/root/.opencode running INFO 2025-10-22T08:30:00 +58ms service=bun code=1 stdout=bun add v1.3.0 (b0a6feca) installed @opencode-ai/plugin@0.15.13

    Failed to install 1 package
    [65.00ms] done
    stderr=FileNotFound: failed copying files from cache to desti
    nation for package @opencode-ai/sdk
    Saved lockfile done ERROR 2025-10-22T08:30:00 +0ms service=default e=Command failed with exit code 1 rejection INFO 2025-10-22T08:30:01 +275ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-10-22T08:30:01 +11ms service=bun pkg=opencode-copil
    ot-auth version=0.0.3 installing package using Bun's default r
    egistry resolution
    INFO 2025-10-22T08:30:01 +1ms service=bun cmd=["/root/.openc$de/bin/opencode","add","--force","--exact","--cwd","/root/.cac
    he/opencode","opencode-copilot-auth@0.0.3"] cwd=/root/.cache/o
    pencode running INFO 2025-10-22T08:30:01 +211ms service=bun code=0 stdout=bun add v1.3.0 (b0a6feca) installed opencode-copilot-auth@0.0.3

    1 package installed [82.00ms]
    stderr=Saved lockfile
    done
    ERROR 2025-10-22T08:30:01 +45ms service=default name=ResolveMe
    ssage message=Cannot find module '/root/.cache/opencode/node_m
    odules/opencode-copilot-auth' from '/$bunfs/root/index.js' cod
    e=ERR_MODULE_NOT_FOUND specifier=/root/.cache/opencode/node_mo
    dules/opencode-copilot-auth referrer=/$bunfs/root/index.js imp
    ortKind=import-statement fatal
    Error: Unexpected error, check log file at for more details

    error: Cannot find module '/root/.cache/opencode/node_modules/
    opencode-copilot-auth' from '/$bunfs/root/index.js'
    INFO 2025-10-22T08:30:01 +587ms service=bun code=0 stdout=bun
    add v1.3.0 (b0a6feca)

    installed @opencode-ai/plugin@0.15.13

    3 packages installed [1154.00ms]
    stderr=Saved lockfile
    done
    [root@localhost ~]#

  17. 621625 commented on Oct 22, 2025

    @621625

    I just resolved a similar module-not-found error by deleting everything and reinstall using npm. Reinstall using bun from scratch does not resolve the error. I suspect it this might have to do with mixup of npm and bun - but i am not familiar with both so this is a pure speculation. I am behind a coporate proxy and bun's support of proxy does not seem to work consistently (It hangs installing missing modules reported by opencode). I suspect that might be the culprit (oven-sh/bun#1440).

    Hello,

    Hope you are well.

    What is the process to delete everything? I also kind of which there were an uninstall flag or something that uninstalls and purges everything.

  18. honzakostejn commented on Nov 7, 2025

    @honzakostejn

    I just resolved a similar module-not-found error by deleting everything and reinstall using npm. Reinstall using bun from scratch does not resolve the error. I suspect it this might have to do with mixup of npm and bun - but i am not familiar with both so this is a pure speculation. I am behind a coporate proxy and bun's support of proxy does not seem to work consistently (It hangs installing missing modules reported by opencode). I suspect that might be the culprit (oven-sh/bun#1440).

    I can confirm this did the trick for me as well.

    cd ~/.cache/opencode
    rm -rf ./node_modules
    npm install
    opencode auth login
  19. ajinkyaT commented on Dec 11, 2025

    @ajinkyaT

    This did't worked for me. getting same error. On version [v1.0.143]

    I just resolved a similar module-not-found error by deleting everything and reinstall using npm. Reinstall using bun from scratch does not resolve the error. I suspect it this might have to do with mixup of npm and bun - but i am not familiar with both so this is a pure speculation. I am behind a coporate proxy and bun's support of proxy does not seem to work consistently (It hangs installing missing modules reported by opencode). I suspect that might be the culprit (oven-sh/bun#1440).

    I can confirm this did the trick for me as well.

    cd ~/.cache/opencode
    rm -rf ./node_modules
    npm install
    opencode auth login

  20. rekram1-node commented on Dec 11, 2025

    @rekram1-node
    Contributor

    @ajinkyaT do you need copilot auth? If not set this env var:
    OPENCODE_DISABLE_DEFAULT_PLUGINS=1

  21. codemuse commented on Dec 11, 2025

    @codemuse

    I had a similar issue, I wanted to use the new GHE support, but I didn't get to the prompt to input the .ghe.com domain, it would just hang on the bun command as it printed int the logs. I found this in another GH issues and that worked for me:

    rm ~/.bun/install/cache -rf 
    
  22. pbassut commented on Dec 30, 2025

    @pbassut

    I had a similar issue, I wanted to use the new GHE support, but I didn't get to the prompt to input the .ghe.com domain, it would just hang on the bun command as it printed int the logs. I found this in another GH issues and that worked for me:

    rm ~/.bun/install/cache -rf 
    

    Confirming that deleting the bun cache worked for me too.

  23. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions