Skip to content

Unable to run opencode when node/npm is managed by Volta #197

Closed

Description

@Traviskn

I use Volta to manage my node version. I am able to install and run claude code via npm without problems. When I install opencode via npm however it is unable to run:

npm i -g opencode-ai@latest
opencode auth login

Volta error: Could not execute command.

See `volta help install` and `volta help pin` for info about making tools available.

I have tried uninstalling and reinstalling with npm and using volta install rather than npm with the same "could not execute command" error. The volta help commands aren't giving me any hints. I'm not quite sure what's going on since other global npm tools work just fine, but wanted to create this issue in case other Volta users run into it.

For now I am installing via Homebrew and opencode works great! Thanks for building this 😄

Activity

  1. thdxr commented on Jun 19, 2025

    @thdxr
    Member

    opencode doesn't use node at all it actually gets installed as a single file executable. not sure what volta is trying to do here - it must hook into some process that is being disrupted

  2. self-assigned this
    on Jun 19, 2025
  3. thdxr commented on Jun 19, 2025

    @thdxr
    Member

    going to close this for now if someone has insight on how to fix this please leave a comment

  4. mrloop commented on Jun 24, 2025

    @mrloop

    The symbolic links in the opencode install were broken. In the image below the red paths are broken.

    opencode-ai/lib/node_modules/opencode-ai/bin/opencode was pointing to a location in a tmp folder .tmpEJcan8/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode and not opencode-ai/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode. Fixing this link and opencode now runs for me

    Image

  5. morgvanny commented on Aug 15, 2025

    @morgvanny

    The package's postinstall script creates a symlink with an absolute path while the package is in a temporary directory during Volta installation. When Volta moves the package to its final location, the symlink becomes broken, pointing to a non-existent temporary path. This makes opencode unusable with Volta.

    The postinstall script for the package uses fs.symlinkSync() with an absolute path to create the symlink. When Volta installs global packages, it:

    1. Installs to a temporary directory first (e.g., ~/.volta/tmp/image/packages/.tmpwVekLa/)
    2. Runs postinstall scripts (symlink created with absolute path to temp dir)
    3. Moves the package to its final location (~/.volta/tools/image/packages/opencode-ai/)
    4. The symlink remains pointing to the now-deleted temporary directory

    I think changing it to a relative path instead would work, because the symlink would be preserved when volta moves the directory. If we update postinstall.mjs and change this line:

    // OLD - creates absolute path symlink
    fs.symlinkSync(binaryPath, binScript);
    
    // NEW - creates relative path symlink
    fs.symlinkSync(path.relative(path.dirname(binScript), binaryPath), binScript);

    That may fix it, if I'm not mistaken.

  6. mrloop commented on Aug 17, 2025

    @mrloop

    Thanks @morgvanny fix working for me 🎉 #2014

  7. adonh commented on Oct 5, 2025

    @adonh

    plx fix in the default post-install script. TY!

  8. rekram1-node commented on Oct 6, 2025

    @rekram1-node
    Contributor

    hm ill take a look

  9. synappsysai commented on Nov 4, 2025

    @synappsysai

    I'm still facing the problem, I installed the latest version through Volta:

    (base) <user>@<user>s-Mac-Studio ~ % cd ~/.volta/tools/image/packages/opencode-ai/
    (base) <user>@<user>s-Mac-Studio opencode-ai % ls -l
    total 0
    drwxr-xr-x  3 <user>  staff  96 Nov  4 16:57 bin
    drwxr-xr-x  3 <user>  staff  96 Nov  4 16:57 lib
    (base) <user>@<user>s-Mac-Studio opencode-ai % cd bin
    (base) <user>@<user>s-Mac-Studio bin % ls -l opencode
    lrwxr-xr-x  1 <user>  staff  44 Nov  4 16:57 opencode -> ../lib/node_modules/opencode-ai/bin/opencode
    (base) <user>@<user>s-Mac-Studio bin % ls -l ../lib/node_modules/opencode-ai/bin/opencode
    lrwxr-xr-x  1 <user>  staff  126 Nov  4 16:57 ../lib/node_modules/opencode-ai/bin/opencode -> /Users/<user>/.volta/tmp/image/packages/.tmpVbIcJj/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode
    (base) <user>@<user>s-Mac-Studio bin % 
    (base) <user>@<user>s-Mac-Studio bin % 
    (base) <user>@<user>s-Mac-Studio bin % ls -l /Users/<user>/.volta/tmp/image/packages/.tmpVbIcJj/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode
    ls: /Users/<user>/.volta/tmp/image/packages/.tmpVbIcJj/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode: No such file or directory
    (base) <user>@<user>s-Mac-Studio bin % 
    
  10. vdenoise commented on May 5, 2026

    @vdenoise

    ⚠️ Infrastructure Failure
    Paperclip API is serving HTML (web app) instead of JSON. Unblock owner: @vincent — verify Paperclip server and PAPERCLIP_API_URL (currently http://127.0.0.1:3100).

    Run ID: $PAPERCLIP_RUN_ID

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