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:
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:
- 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 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?
Environment
Steps to reproduce
Run:
Volta reports:
However, running
opencodeproduces the Windows error indicating that the executable is incompatible with the current version of Windows.Actual behavior
The installed file was:
It was only 479 bytes and contained an error placeholder stating:
The package's
postinstall.mjsscript 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
npm 12 disables dependency lifecycle scripts by default unless they are explicitly allowed. It appears that
volta installdoes not pass an appropriate--allow-scriptsoption for package binaries that require a postinstall step.Expected behavior
One of the following should happen:
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
allowScriptsbehavior?What is the supported way to install package binaries whose functionality depends on a
postinstallscript through Volta?