Skip to content

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

Description

@ReneXiong

Environment

  • OS: Windows 11 x64
  • Volta: 2.0.2
  • Node.js: 24.16.0
  • npm: 12.0.1
  • Package: opencode-ai@1.18.10

Steps to reproduce

Run:

volta install opencode-ai@latest
opencode

Volta reports:

success: installed opencode-ai@1.18.10 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:

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

the correct Windows x64 binary was installed and:

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?

Metadata

Metadata

Assignees

No one assigned

    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