volta install reports success but skips opencode-ai postinstall under npm 12
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:
volta install opencode-ai@latest
opencodeVolta reports:
success: installed [email protected] with executables: opencodeHowever, 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.exeIt 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.mjsthe correct Windows x64 binary was installed and:
opencode --versionworked 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:
- Volta should run the required lifecycle script for the package; or
- Volta should provide a way to explicitly allow the package's install script; or
- If the script is skipped,
volta installshould 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?
Source: volta-cli/volta