#2111·volta

volta install reports success but skips opencode-ai postinstall under npm 12

Author: ReneXiongCreated Aug 6, 2026Updated Aug 6, 2026

Environment

  • OS: Windows 11 x64
  • Volta: 2.0.2
  • Node.js: 24.16.0
  • npm: 12.0.1
  • Package: [email protected]

Steps to reproduce

Run:

powershell
volta install opencode-ai@latest
opencode

Volta reports:

success: installed [email protected] with executables: opencode

However, running opencode produces the Windows error indicating that the executable is incompatible with the current version of Windows.

Actual behavior

The installed file was:

%LOCALAPPDATA%\Volta\tools\image\packages\opencode-ai\node_modules\opencode-ai\bin\opencode.exe

It was only 479 bytes and contained an error placeholder stating:

Error: opencode-ai's postinstall script was not run.

The package's postinstall.mjs script was not executed, so the real Windows native binary was not installed.

After manually running:

powershell
cd "$env:LOCALAPPDATA\Volta\tools\image\packages\opencode-ai\node_modules\opencode-ai"
node .\postinstall.mjs

the correct Windows x64 binary was installed and:

powershell
opencode --version

worked successfully.

npm configuration

ignore-scripts = false
allow-scripts = [""]

npm 12 disables dependency lifecycle scripts by default unless they are explicitly allowed. It appears that volta install does not pass an appropriate --allow-scripts option for package binaries that require a postinstall step.

Expected behavior

One of the following should happen:

  1. Volta should run the required lifecycle script for the package; or
  2. Volta should provide a way to explicitly allow the package's install script; or
  3. If the script is skipped, volta install should fail with an actionable error instead of reporting successful installation.

A successful installation should not leave a non-functional placeholder executable behind.

Questions

Could you confirm whether this is a compatibility issue between Volta and npm 12's allowScripts behavior?

What is the supported way to install package binaries whose functionality depends on a postinstall script through Volta?