Date: 2026-01-11
Installation Method: curl -fsSL https://opencode.ai/install | bash
OpenCode Version: 1.1.13
Installation Status: FAILED - Critical runtime errors despite successful installation
OS: Linux 6.17.0-PRoot-Distro Shell: bash Python Version: 3.13.7 Curl Version: 8.18.0
/home/arnab/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/data/data/com.termux/files/usr/bin:/system/bin:/system/xbin
The OpenCode installation script successfully downloads and installs the binary to /home/arnab/.opencode/bin/opencode, but the command is not immediately accessible in the current shell session after installation.
-
Initial pip attempt failed:
pip install opencode ERROR: Could not find a version that satisfies the requirement opencode ERROR: No matching distribution found for opencode -
Curl install script execution appeared successful:
curl -fsSL https://opencode.ai/install | bashOutput showed:
- Installing opencode version: 1.1.13
- Successfully added opencode to $PATH in /home/arnab/.bashrc
- Displayed success message with ASCII art logo
- Exit code: 0
-
Post-installation verification failed:
opencode --version bash: opencode: command not foundwhich opencode (no output, exit code 1)
After sourcing .bashrc to fix the PATH issue, extensive testing revealed critical runtime errors:
- Version check:
opencode --version→1.1.13✅ - Help command:
opencode --help→ Displays full help ✅ - Models list:
opencode models→ Lists available models ✅- opencode/big-pickle
- opencode/glm-4.7-free
- opencode/gpt-5-nano
- opencode/grok-code
- opencode/minimax-m2.1-free
- Debug paths:
opencode debug paths→ Shows all paths ✅
-
Stats command:
opencode stats
Error: Unexpected error, check log file at /home/arnab/.local/share/opencode/log/2026-01-11T181150.log error: Cannot find module '/home/arnab/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/src/index.js' -
Run command:
opencode run "hello"Error: Cannot find module '/home/arnab/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/src/index.js' -
Debug config:
opencode debug config
Error: Cannot find module '/home/arnab/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/src/index.js'
The log file (/home/arnab/.local/share/opencode/log/2026-01-11T181150.log) shows:
- Installation appears to bootstrap correctly
- Plugin installation via bun succeeds:
bun add @opencode-ai/[email protected] --exact installed @opencode-ai/[email protected] - Plugin loading starts:
INFO service=plugin name=CodexAuthPlugin loading internal plugin INFO service=plugin [email protected] loading plugin - Critical error occurs:
ERROR service=default name=ResolveMessage message=Cannot find module '/home/arnab/.cache/opencode/node_modules/opencode-copilot-auth' from '/$bunfs/root/src/index.js' code=ERR_MODULE_NOT_FOUND
The module does exist in the expected location:
ls -la /home/arnab/.cache/opencode/node_modules/
# Shows: opencode-copilot-auth (directory exists and is accessible)The error indicates a Bun virtual filesystem (bunfs) path resolution issue:
- The module exists at
/home/arnab/.cache/opencode/node_modules/opencode-copilot-auth - Bun is trying to load it from a virtual path:
/$bunfs/root/src/index.js - The virtual filesystem is not correctly mapping to the actual filesystem paths
This appears to be a bug specific to Linux 6.17.0-PRoot-Distro or the Bun runtime on this platform.
-
Checked installation directory:
ls -la /home/arnab/.opencode/bin/ -rwxr-xr-x 1 arnab arnab 137115052 Jan 11 07:09 opencode
- Result: Binary exists and is executable (137 MB)
-
Checked .bashrc modifications:
grep opencode ~/.bashrc # opencode export PATH=/home/arnab/.opencode/bin:$PATH
- Result: PATH export was successfully added to ~/.bashrc
-
Verified binary works with manual PATH update:
export PATH=/home/arnab/.opencode/bin:$PATH && opencode --version 1.1.13
- Result: Binary is functional when PATH is manually updated
The installation script modifies ~/.bashrc to add OpenCode to PATH, but does not:
- Source the
.bashrcfile after modification - Update the current shell session's PATH environment variable
- Inform the user that they need to restart their shell or run
source ~/.bashrc
This creates a confusing user experience where the installation reports success, but the command is not immediately available.
-
Missing .local/bin in PATH: The default PATH does not include
/home/arnab/.local/bin/, even though other binaries (likedroidandclaude) are installed there. -
No explicit instructions: The installation output does not mention the need to source
.bashrcor restart the shell. -
Silent failure: Users may assume the installation failed because the command isn't accessible, when in fact it was installed successfully.
- Run:
curl -fsSL https://opencode.ai/install | bash - Observe success message
- Attempt to run:
opencode --version - Command not found error occurs
# At the end of the install script
source ~/.bashrc# After adding to .bashrc, also set for current session
export PATH="/home/arnab/.opencode/bin:$PATH"Add a clear message after installation:
OpenCode installed successfully!
Please run the following command to update your PATH:
source ~/.bashrc
Or restart your terminal session.
Instead of relying on PATH modification, create a symlink:
ln -s ~/.opencode/bin/opencode /usr/local/bin/opencode
# or
ln -s ~/.opencode/bin/opencode ~/.local/bin/opencodeUsers can manually fix this by running:
source ~/.bashrcOr by adding the following line to their current session:
export PATH=/home/arnab/.opencode/bin:$PATHSeverity: CRITICAL Impact: OpenCode is completely non-functional - While basic commands work, any command that requires loading plugins or running the core AI features fails with a module resolution error. The tool cannot be used for its primary purpose. Workaround Available: No - The bunfs path resolution issue appears to be a platform-specific bug that cannot be worked around by users. Risk: HIGH - Users will install OpenCode expecting it to work, but will encounter cryptic error messages when trying to use the actual AI features.
-
Initial Issue: Installation script doesn't source
.bashrc, making the command unavailable immediately (UX issue, easily fixable) -
Critical Issue: After fixing the PATH, OpenCode fails to load any plugins or run core functionality due to a Bun virtual filesystem path resolution bug on Linux 6.17.0-PRoot-Distro
-
Result: OpenCode is effectively unusable on this platform, despite successful installation and some basic commands working
- Installation URL: https://opencode.ai/install
- Documentation: https://opencode.ai/docs/
- GitHub Repository: https://github.com/sst/opencode
PRoot Environment:
This appears to be running inside a PRoot (pseudo-root) environment, which may have implications for Bun's virtual filesystem implementation. PRoot creates a user-space chroot-like environment that may not be fully compatible with Bun's bunfs virtual filesystem layer.
Potential Bun Compatibility Issues:
- PRoot may not fully support the
memfd_createsystem call that Bun uses for certain operations - Symbolic link handling in PRoot environments may differ from native Linux
- Path resolution across the PRoot virtualization boundary may cause Bun's module loader to fail
Suggested Investigation for OpenCode Team:
- Test OpenCode on standard Linux distributions (not PRoot-based)
- Check Bun's compatibility with PRoot environments
- Consider adding a fallback mechanism when bunfs path resolution fails
- Add better error messages that indicate platform compatibility issues
Alternative Installation Methods Attempted (Failed):
pip install opencode- Package not found on PyPIbrew install opencode- Not applicable (not macOS)scoop install opencode- Not applicable (not Windows)npm i -g opencode-ai@latest- Not attempted due to pip failure
Platform-Specific Commands for Debugging:
To help diagnose this issue on similar systems, the OpenCode team should consider adding platform detection:
# Check for PRoot environment
[ -f /.dockerenv ] || [ -d /proc/self/root ] && echo "Running in container/PRoot"
# Check Bun version
bun --version
# Test Bun module loading
bun test # If there's a test suite