You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
@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.
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
❯ 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
Activity
thdxr commentedon Jul 5, 2025
does
~/.opencodeexist?MatthewScholefield commentedon Jul 13, 2025
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.
keeganmccallum commentedon Jul 14, 2025
I think it's maybe another linked file, the file itself is there but throws the error message
Huge commentedon Jul 16, 2025
As Callum has said, yes it exists. I'm curious about the
if it is part of this repository, I've not found it.
thdxr commentedon Jul 16, 2025
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
alkadras commentedon Jul 17, 2025
Bu sorunu çözebilecek bir yok mu
tspader commentedon Aug 3, 2025
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
filip-risteski commentedon Sep 12, 2025
I just tried this, same issue
code-with-nex commentedon Sep 30, 2025
@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.
pobeda1 commentedon Oct 12, 2025
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!)
pobeda1 commentedon Oct 13, 2025
Bun on Termux · Issue #8685 · oven-sh/bun oven-sh/bun#8685
Maybe this thing affects. Because can't run bun too.
honzakostejn commentedon Nov 7, 2025
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.
Steven-Martin-CC commentedon Nov 29, 2025
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
timerloggedout-spec commentedon Jun 17, 2026