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: opencode-ai install fails with PE loader error on stub .exe #38169
When installing the opencode-ai npm package on Windows, if postinstall fails or is skipped (--ignore-scripts), running opencode produces a Windows PE loader error:
The specified executable is not a valid application for this OS platform
Root Cause
The published package ships �in/opencode.exe as a text-file placeholder stub. npm generates direct-execution .exe wrappers on Windows, so the PE loader tries to run the text file directly. The meaningful error message inside the stub is never displayed because Windows rejects it before Node.js can run it.
Expected Behavior
If the binary is missing or installation is incomplete, the CLI should print a clear, actionable error message instead of a confusing PE loader error.
Steps to Reproduce
Install opencode-ai on Windows with --ignore-scripts
Run opencode
Observe the PE loader error
Suggested Fix
Replace the stub .exe with a Node.js .mjs launcher. npm generates
ode <script> wrappers for .mjs entries, bypassing the PE loader entirely. The launcher can validate binary existence and print clear error messages.
Activity
github-actions commentedon Jul 21, 2026
This issue might be a duplicate of existing issues. Please check:
opencode.exeleft when postinstall is blocked, producing the same "not a valid application for this OS platform" error on Windowsnpm install -g opencode-aigithub-actions commentedon Sep 20, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.