Skip to content

v2: Plugin from git url - NPM + BUN conflict error #49785

Closed as duplicate
Closed as duplicate

Description

@BananaAcid

Description

using, as an example, in opencode.jsonc :

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [
    {
      "package": "git+https://github.com/tickernelz/opencode-mem.git#opencode-api-v2",
      "options": { }
    }
  ]
}

I get an error from NPM being in conflict with BUN (it seems to me)

NpmInstallFailedError: 
    at catch (B:/~BUN/root/chunk-3kgbfgap.js:3:9450)
    at ~effect/Utils/internal (B:/~BUN/root/chunk-a43cxxb8.js:8:1535)
    at s (B:/~BUN/root/chunk-a43cxxb8.js:24:6055)
    at processTicksAndRejections (native:7:39)
    at Npm.reify (B:/~BUN/root/chunk-3kgbfgap.js:3:9497)
    at Npm.add (B:/~BUN/root/chunk-7n9n93n5.js:1500:8385)
    at Npm.add (definition) (B:/~BUN/root/chunk-3kgbfgap.js:3:9533)
    at PluginSupervisor.load (B:/~BUN/root/chunk-7n9n93n5.js:1500:7787)
    at PluginSupervisor.load (definition) (B:/~BUN/root/chunk-7n9n93n5.js:1500:8267)
    at PluginSupervisor.resolve (B:/~BUN/root/chunk-7n9n93n5.js:1500:9317)
    at PluginSupervisor.resolve (definition) (B:/~BUN/root/chunk-7n9n93n5.js:1500:7258)
    at PluginSupervisor.activate (B:/~BUN/root/chunk-7n9n93n5.js:1500:9652)
    at PluginSupervisor.activate (definition) (B:/~BUN/root/chunk-7n9n93n5.js:1500:9063)
    at ServerProcess.start (B:/~BUN/root/chunk-shccbgfk.js:2:6330) {
  [cause]: Error: git dep preparation failed
      at vt (B:/~BUN/root/chunk-53kf4b4q.js:8:4483)
      at processTicksAndRejections (unknown:7:39)
}

NodeJS is installed on the device, opencode2 is installed as global package on NodeJS.

Plugins

tickernelz/opencode-mem.git#opencode-api-v2

OpenCode version

opencode2 v0.0.0-beta-17823

Steps to reproduce

configure a plugin with a github path, as per bun/npm spec.

Operating System

win11

Terminal

Terminal.app

Shell

pwsh.exe 7.5.0

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the report and the full stack trace!

    I think this is a duplicate of #49704. When a plugin is installed from a git URL, OpenCode uses npm's git fetcher internally. If the plugin's package.json has a build, prepare, prepack, install, preinstall or postinstall script, the fetcher runs an extra "preparation" install, and that step fails with exactly git dep preparation failed. The package.json on tickernelz/opencode-mem's main branch has both "build" and "prepare": "husky"; I couldn't read the opencode-api-v2 branch, but I expect it has the same scripts. Having Node/npm installed next to Bun shouldn't be what causes this.

    Possible duplicates and related issues, most likely first:

    Until it's fixed, installing the plugin from npm (if a published version works for you), or from a fork without those scripts, should get around it.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Closing this as a duplicate of #49704, since there's been no reply in the past day. The git dep preparation failed error happens when a git-installed plugin's package.json has a build or prepare script. opencode-mem has both on its main branch, and I expect the opencode-api-v2 branch is the same. #59504 covers the Windows-specific side of the same failure. Until it's fixed, installing the plugin from npm or from a fork without those scripts should get around it. Please follow #49704 for the fix. If your problem turns out to be different, reply here and it can be reopened. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions