Skip to content

Opencode-ai v1.15.3 - Corrupted executable on Windows #27963

Closed as not planned
Closed as not planned

Description

@DevMILF

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.0

Additional Notes

  1. The installation itself completes without errors — only the execution fails
  2. The binary file exists at the expected path but Windows rejects it
  3. The size of the binary may be truncated or corrupted during the npm publish process
  4. This issue is Windows-specific — Linux/macOS builds may be unaffected

Related

  • The issue tracker for opencode-ai on 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 header

Plugins

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 --version

Expected 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

Activity

  1. github-actions commented on May 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. MarvinXu commented on May 17, 2026

    @MarvinXu

    why closed?

    Image
  3. buxiua commented on May 19, 2026

    @buxiua

    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:

    Image

    when run opencode in cmd:

    Image
  4. MarvinXu commented on May 19, 2026

    @MarvinXu

    It turns out I need to run pnpm approve-builds -g after install opencode

  5. buxiua commented on May 19, 2026

    @buxiua

    It turns out I need to run pnpm approve-builds -g after install opencode

    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!

  6. jonaspm commented on May 19, 2026

    @jonaspm

    how to do that with bun/npm? I do not use pnpm but have the same issue

  7. yyyyyzc commented on May 22, 2026

    @yyyyyzc

    It turns out I need to run pnpm approve-builds -g after install opencode

    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!

    Correct! pnpm blocks automatic build scripts by default, so you need to run pnpm approve-builds -g immediately after installation, or add the --allow-build flag during the installation process.

  8. Alkon23 commented on May 22, 2026

    @Alkon23

    For npm users, this happens if you enabled ignore-scripts.

    What worked for me:

    # Remove current version
    npm uninstall -g opencode-ai
    
    # Install a working version if you don't trust postinstall scripts
    npm i -g [email protected]
    # Or install the latest one 
    npm i -g --ignore-scripts=false opencode-ai
    
    # Update to latest allowing postinstall scripts
    npm update -g --ignore-scripts=false opencode-ai

    Additionally, you can disable opencode autoupdate so it doesn't break next time:

    {
      "$schema": "https://opencode.ai/config.json",
      "autoupdate": "notify"
    }
  9. mynameistito commented on May 26, 2026

    @mynameistito
    Contributor

    after chatting with a core member, I did the following which fixed it for me on my related issue.

    bun pm trust opencode-ai

    alternatively the below in ya root package.json

      "trustedDependencies": [
        "opencode-ai"
      ],
    

    I assume pnpm has a similiar cmd.

  10. fotorpics commented on Jul 7, 2026

    @fotorpics

    bun pm trust opencode-ai

    Fix : Run postinstall script : node C:/Users/YOUR_NAME/AppData/Roaming/npm/node_modules/opencode-ai/postinstall.mjs

  11. tinlevn commented on Sep 5, 2026

    @tinlevn

    I have this issue too, 5th Sep 26'

  12. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions