Repository navigation
Closed as not planned
Description
Description
Bug Report: opencode-ai v1.15.3 - Corrupted executable on Windows
Description
Version 1.15.3 of opencode-ai ships a corrupted binary on Windows 10/11. The executable fails to launch with the error:
"The specified executable is not a valid application for this OS platform"
Version 1.15.0 works correctly. The issue is reproducible on fresh install and reinstall.
Environment
| Field | Value |
|---|---|
| OS | Windows 10 Pro 22H2 / Windows 11 |
| Arch | x64 |
| Shell | PowerShell 5.1 |
| Package Manager | pnpm 11.1.1 |
| Node.js | v22.x |
Workaround
Downgrade to v1.15.0:
pnpm install -g opencode-ai@1.15.0Additional Notes
- The installation itself completes without errors — only the execution fails
- The binary file exists at the expected path but Windows rejects it
- The size of the binary may be truncated or corrupted during the npm publish process
- This issue is Windows-specific — Linux/macOS builds may be unaffected
Related
- The issue tracker for
opencode-aion GitHub - pnpm global install path:
%LOCALAPPDATA%\pnpm\global\v11\*\node_modules\opencode-ai\
Debug Info
# Check file details
Get-Item "$env:LOCALAPPDATA\pnpm\global\v11\*\node_modules\opencode-ai\bin\opencode.exe" | Select-Object Name, Length, LastWriteTime
# Expected: binary ~50-100MB, normal timestamp
# Actual (v1.15.3): binary may show incorrect size or corrupted PE headerPlugins
No response
OpenCode version
v1.15.3
Steps to reproduce
Steps to Reproduce
# 1. Install latest version
pnpm install -g opencode-ai@1.15.3
# 2. Try to run
opencode --versionExpected behavior
1.15.3
Actual behavior
Program 'opencode.exe' failed to run: The specified executable is not a valid application for this OS platform.
At C:\Users\%userprofile%\AppData\Local\pnpm\bin\opencode.ps1:14 char:3
+ & "$basedir/../global/v11/xxxx/node_modules/opencode-ai ..."
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
+ CategoryInfo : ResourceUnavailable: (:), ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
Reproducibility
- Always reproducible
- Survives
pnpm store prune --force+ reinstall - Survives
pnpm uninstall -g opencode-ai+ reinstall
Screenshot and/or share link
No response
Operating System
No response
Terminal
Warp
Reacted by Sergionx, AtletiaApp, munenari, fanjieqi, Dylan Barnett and patas12Monkeys
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon May 17, 2026
This issue might be a duplicate of existing issues. Please check:
MarvinXu commentedon May 17, 2026
why closed?
buxiua commentedon May 19, 2026
I meet the same error on my windows.
pnpm: 10.18.3
node: v23.11.1
opencode: 1.15.5
windows: win11 25h2 26200.8457
when run opencode in PowerShell:
when run opencode in cmd:
MarvinXu commentedon May 19, 2026
It turns out I need to run
pnpm approve-builds -gafter install opencodebuxiua commentedon May 19, 2026
but when i run
pnpm approve-builds -g, there is no any package.so i reinstall opencode-ai, and then
pnpm approve-builds -g, it finally works!jonaspm commentedon May 19, 2026
how to do that with bun/npm? I do not use pnpm but have the same issue
yyyyyzc commentedon May 22, 2026
Correct!
pnpmblocks automatic build scripts by default, so you need to runpnpm approve-builds -gimmediately after installation, or add the--allow-buildflag during the installation process.Alkon23 commentedon May 22, 2026
For
npmusers, this happens if you enabledignore-scripts.What worked for me:
Additionally, you can disable opencode autoupdate so it doesn't break next time:
{ "$schema": "https://opencode.ai/config.json", "autoupdate": "notify" }mynameistito commentedon May 26, 2026
after chatting with a core member, I did the following which fixed it for me on my related issue.
bun pm trust opencode-aialternatively the below in ya root
package.jsonI assume pnpm has a similiar cmd.
fotorpics commentedon Jul 7, 2026
Fix : Run postinstall script : node C:/Users/YOUR_NAME/AppData/Roaming/npm/node_modules/opencode-ai/postinstall.mjs
tinlevn commentedon Sep 5, 2026
I have this issue too, 5th Sep 26'
thdxr 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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊