Skip to content

YOLO script not helpful in Termux  #709

Closed

Description

@Huge
...
Successfully added opencode to $PATH in /data/data/com.termux/files/home/.bashrc
12:48:51 u0_a338@localhost ~ → opencode
No command opencode found, did you mean:
 Command qrencode in package libqrencode
 Command uuencode in package sharutils
12:49:31 u0_a338@localhost ~ → source .bas
.bash_history  .bash_profile  .bashrc
12:49:31 u0_a338@localhost ~ → source .bashrc
12:49:58 u0_a338@localhost ~ → opencode
bash: /data/data/com.termux/files/home/.opencode/bin/opencode: cannot execute: required file not found

After the last error I have no idea for a fix, at least a more specific error message would help.

Activity

  1. self-assigned this
    on Jul 5, 2025
  2. thdxr commented on Jul 5, 2025

    @thdxr
    Member

    does ~/.opencode exist?

  3. MatthewScholefield commented on Jul 13, 2025

    @MatthewScholefield

    The file exists but I assume it's the wrong architecture and that error results in a slightly misleading / incorrect error message of file does not exist.

  4. keeganmccallum commented on Jul 14, 2025

    @keeganmccallum

    I think it's maybe another linked file, the file itself is there but throws the error message

  5. Huge commented on Jul 16, 2025

    @Huge
    Author

    does ~/.opencode exist?

    As Callum has said, yes it exists. I'm curious about the

    required file not found

    if it is part of this repository, I've not found it.

  6. thdxr commented on Jul 16, 2025

    @thdxr
    Member

    i'm not too sure - not exactly easy for me to reproduce this so would need someone who has the issue to do some digging

  7. alkadras commented on Jul 17, 2025

    @alkadras

    Bu sorunu çözebilecek bir yok mu

  8. tspader commented on Aug 3, 2025

    @tspader

    I reproduced this when I tried to install in an Alpine container running on macOS. It installed the arm64 binary (which matches the host machine, not the container, which is running through Rosetta). I have no idea if this is something the package maintainer needs to fix in the metadata or if this is something that doesn't work in npm/pnpm. But the issue is definitely what was suggested, wrong architecture

  9. filip-risteski commented on Sep 12, 2025

    @filip-risteski

    I just tried this, same issue

  10. code-with-nex commented on Sep 30, 2025

    @code-with-nex

    @Huge I experienced the same issue, which I believe was due to how Termux represents Android. Switching to a proot distribution (Debian, in my case) resolved it, and I can now work without problems.

  11. pobeda1 commented on Oct 12, 2025

    @pobeda1

    Your architecture (this is the real issue)

    uname -m

    Output: aarch64 (Android ARM64)

    What the npm package expects

    - opencode-linux-x64 (Linux, 64-bit Intel)

    - opencode-darwin-x64 (macOS, Intel)

    - opencode-darwin-arm64 (macOS, Apple Silicon)

    - opencode-android-arm64 ❌ (Missing - this is what you need!)

  12. pobeda1 commented on Oct 13, 2025

    @pobeda1

    Bun on Termux · Issue #8685 · oven-sh/bun oven-sh/bun#8685

    Maybe this thing affects. Because can't run bun too.

  13. honzakostejn commented on Nov 7, 2025

    @honzakostejn

    I'm able to run opencode from flake on nix-on-droid (nix enabled fork of Termux) without root. If this is still not working for you, you can try this.

  14. Steven-Martin-CC commented on Nov 29, 2025

    @Steven-Martin-CC
    Contributor

    On termux I think this is the problem:
    /data/data/com.termux/files/home/.opencode/bin/opencode: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=61c89cbce93de43843a486719fdbfd10f711c71d, not stripped

    Termux uses Bionic libc not glibc

  15. timerloggedout-spec commented on Jun 17, 2026

    @timerloggedout-spec
    ❯ ls .opencode
    bin
    ❯ ls .opencode/bin
    opencode
    ❯ ~/.opencode/bin/opencode --version
    zsh: no such file or directory: /data/data/com.termux/files/home/.opencode/bin/opencode
    ❯ ~/.opencode/bin/opencode --version
    zsh: no such file or directory: /data/data/com.termux/files/home/.opencode/bin/opencode
    ❯ source .zshrc
    ❯ ~/.opencode/bin/opencode --version
    zsh: no such file or directory: /data/data/com.termux/files/home/.opencode/bin/opencode
    ❯ patchelf --set-interpreter $PREFIX/lib/ld-android.so ~/.opencode/bin/opencode
    
    
    ❯
    ❯ ~/.opencode/bin/opencode --version                       zsh: no such file or directory: /data/data/com.termux/files/home/.opencode/bin/opencode
    ❯ npm install -g opencode-ai@latest
    
    npm error code EBADPLATFORM
    npm error notsup Unsupported platform for opencode-ai@1.17.7: wanted {"os":"darwin,linux,win32","cpu":"arm64,x64"} (current: {"os":"android","cpu":"arm64"})
    npm error notsup Valid os:   darwin,linux,win32
    npm error notsup Actual os:  android
    npm error notsup Valid cpu:  arm64,x64
    npm error notsup Actual cpu: arm64
    npm error A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2026-06-17T14_31_51_276Z-debug-0.log
    ❯ npm install -g opencode-ai@latest --ignore-scripts --force
    
    npm warn using --force Recommended protections disabled.
    
    added 1 package in 24s
    ❯ opencode --version
    
    Error: opencode-ai's postinstall script was not run.
    
    This occurs when using --ignore-scripts during installation, or when using a
    package manager like pnpm that does not run postinstall scripts by default.
    
    To fix this, run the postinstall script manually:
      cd node_modules/opencode-ai && node postinstall.mjs
    
    Or reinstall opencode-ai without the --ignore-scripts flag.
    ❯ cd node_modules/opencode-ai && node postinstall.mjs
    cd: no such file or directory: node_modules/opencode-ai
    ❯ cd ~/node_modules/opencode-ai && node postinstall.mjs
    cd: no such file or directory: /data/data/com.termux/files/home/node_modules/opencode-ai
    ❯ cd $PREFIX/lib/node_modules/opencode-ai
    
    ❯ node postinstall.mjs                                     
    It seems your package manager failed to install the right opencode CLI package. Try manually installing "opencode-android-arm64".
    ❯ npm install -g opencode-android-arm64                    npm error code E404
    npm error 404 Not Found - GET https://registry.npmjs.org/opencode-android-arm64 - Not found
    npm error 404
    npm error 404  The requested resource 'opencode-android-arm64@*' could not be found or you do not have permission to access it.
    npm error 404
    npm error 404 Note that you can also install from a
    npm error 404 tarball, folder, http url, or git url.
    npm error A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2026-06-17T14_42_20_410Z-debug-0.log
    /data/data/com.termux/files/usr/lib/node_modules/opencode-ai 6s ❯                                            07:42:25
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions