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
{{ message }}
Repository navigation
Windows: postinstall fails to copy binary from optionalDependency — stub remains 479 bytes #41370
After installing or updating opencode-ai via npm on Windows, the opencode command fails with:
Error al ejecutar el programa 'opencode.exe': El ejecutable especificado no es una aplicación válida para esta plataforma de sistema operativo.
The root cause: the postinstall.mjs script fails to copy the real platform-specific binary over the stub. The bin/opencode.exe remains a 479-byte stub instead of the ~174MB real binary.
Environment
OS: Windows 10/11 x64
Node.js: v22.16.0
npm: global install
opencode-ai version: 1.18.11 (also reproducible on 1.18.15)
Saw the 479-byte stub after your npm install -g opencode-ai reinstall...... classic Defender signature-match swallowing the binary copy in postinstall.mjs. The fs.linkSync / copyFileSync fallback in that script swallows the failure and exits 0, so npm thinks everything's fine. Easiest unblock: add opencode-ai's npm cache + your %LOCALAPPDATA%\npm-cache\_npx and the global install path to a Defender exclusion, then rerun npm install -g opencode-ai. Or just disable real-time protection for the install window and re-enable. Btw, I keep a portable Hermes-OTG on a USB stick for exactly these 'Windows toolchain half-broken' moments...... imo, runs the same agent framework side-by-side so you can keep working while the install heals. https://github.com/MilkyWay008/Hermes-OTG
Activity
github-actions commentedon Aug 9, 2026
This issue might be a duplicate of existing issues. Please check:
MilkyWay008 commentedon Aug 17, 2026
Saw the 479-byte stub after your
npm install -g opencode-aireinstall...... classic Defender signature-match swallowing the binary copy in postinstall.mjs. Thefs.linkSync/copyFileSyncfallback in that script swallows the failure and exits 0, so npm thinks everything's fine. Easiest unblock: add opencode-ai's npm cache + your%LOCALAPPDATA%\npm-cache\_npxand the global install path to a Defender exclusion, then rerunnpm install -g opencode-ai. Or just disable real-time protection for the install window and re-enable. Btw, I keep a portable Hermes-OTG on a USB stick for exactly these 'Windows toolchain half-broken' moments...... imo, runs the same agent framework side-by-side so you can keep working while the install heals. https://github.com/MilkyWay008/Hermes-OTGthdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊