Repository navigation
Description
Summary
opencode plugin add, plugin check, and plugin update consistently fail on Windows for package-based TUI plugins with NpmInstallFailedError. add fails with cause Error: unable to resolve dependency tree; check fails with cause Error: Package is not installed. The failure is independent of the user's dependency tree (it reproduces with an empty package.json), while system npm resolves and installs the same packages without issues. As a result, package TUI plugins never load in 2.1.4 and every client start logs plugin operation failed ... NpmInstallFailedError ... stage=prepare.
Environment
- opencode version: 2.1.4 (channel
latest, installed via npm global@opencode/cli) - OS: Windows 10.0.26300 (win32 x64)
- Terminal: Unavailable (headless shell context; reproduced both from an interactive terminal and non-interactively)
- Shell: PowerShell 7 (pwsh)
- Install/channel: latest
- Active plugins: 4 local V2 server plugins (load and work correctly), 1 local TUI plugin loaded by file path, plus the 2 failing package plugins (
opencode-subagent-statusline,opencode-sdd-engram-manage)
Reproduction
-
On Windows with opencode 2.1.4, run:
opencode plugin add opencode-sdd-engram-manage
Also reproduces with
opencode-subagent-statusline, and with a pinned old version ([email protected]) that worked under V1. -
Observe the failure:
NpmInstallFailedError at Npm.reify (...) at Npm.add (...) { [cause]: Error: unable to resolve dependency tree } -
Replace
~/.config/opencode/package.jsonwith{ "dependencies": {} }and retry → same failure. (Tested with backup/restore of the original file.) This rules out a broken user dependency tree as the cause. -
Run
opencode plugin check→ both packages report(check failed)with causeError: Package is not installed: <pkg>. -
In the same directory, system npm works fine:
npm view <pkg> versionandnpm installboth succeed againstregistry.npmjs.org(no proxy configured, registry reachable).
Expected Behavior
opencode plugin add <pkg> installs the package into opencode's internal plugin cache and registers it in the global configuration; plugin check reports update availability for installed package plugins.
Actual Behavior
add/check/updatealways fail withNpmInstallFailedError.- The internal per-package install roots under
~/.cache/opencode/npm/<pkg>@<spec>/exist but remain empty (the populated cache under~/.cache/opencode/packages/dates from before the V2 upgrade and is no longer recognized — hence "Package is not installed" on check). opencode plugin listdoes not list the package plugins at all: they never load.- Every client start logs repeated reconciliation failures:
plugin operation failed ... error=NpmInstallFailedError ... stage=prepare ... install=true.
Additional Context
- The peer dependency ranges of both packages are satisfiable by what is installed, so this does not look like an unsolvable peer conflict:
[email protected]peers:@opencode-ai/plugin >=1.17.11(satisfied by the installed@opencode-ai/plugin 1.18.15),solid-js 1.9.12,@opentui/*.[email protected]peers:@opencode/plugin >=2.0.0 <3(satisfied after installing@opencode/[email protected]),solid-js,@opentui/*.- The failure predates installing
@opencode/[email protected]and persists after it.
- The stack traces point at the bundled Bun-based installer (
B:/~BUN/root/...,Npm.reify,Npm.check,Npm.add), so the resolution failure happens inside opencode's embedded package manager, not the system npm. - This worked under OpenCode V1 (the populated
~/.cache/opencode/packages/entries are from before the upgrade); it has been broken since upgrading to V2 2.1.4. - Workaround attempted: installing the packages manually with system npm into
~/.config/opencode/node_modules— the packages are present there, but the internal manager still does not recognize them ("Package is not installed"), andplugin addstill fails.
Activity
opencode-agent commentedon Oct 26, 2026
Thanks for the detailed report! I think this is a duplicate of #50080. It covers the same package (
opencode-sdd-engram-manage) failing the same way:plugin add/updatefails inNpm.reifywithunable to resolve dependency tree, startup reconciliation logsNpmInstallFailedErroratstage=prepareon every launch, the~/.cache/opencode/npm/<pkg>@<spec>folder stays empty, and system npm installs the package fine. Comments there confirm it on Windows with 2.0.30, 2.1.1 and 2.1.2.Possible duplicates and related issues, ordered by likelihood:
@latestspec fails while an exact version installs. Reported on Linux and Windows.stage=prepareNpmInstallFailedErroron Windows withopencode-sdd-engram-manageandopencode-subagent-statusline(closed as a duplicate of plugin install: TUI plugin fails with empty NpmInstallFailedError — resolver rejects a spec npm installs fine #50080).In #50080, the reported workaround is to pin an exact version, e.g.
opencode plugin add [email protected], or"[email protected]"incli.json. You mention that a pinned[email protected]also failed. If pinning[email protected](or[email protected]) fails for you too, please reply with the output, because that would point to a different problem. Otherwise, a short comment on #50080 saying it still happens on 2.1.4 on Windows would help.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
jgarrone82 commentedon Oct 26, 2026
Tested on 2.1.4 / Windows 11, exactly as suggested, with exact pins on our
~/.config/opencode:opencode plugin add [email protected]→ exit 0, installs fine ("installed and added to cli.json").opencode plugin add [email protected]→ exit 1, sameNpmInstallFailedErrorfromNpm.reifywith causeunable to resolve dependency tree.So this is not fully covered by the exact-pin workaround in #50080: with an exact pin it still fails when the peer tree cannot be resolved. The discriminator between these two packages:
[email protected]peers on@opentui/coreand@opentui/solidwith">=0.5.0 <0.7", but this config has@opentui/core/@opentui/solid0.4.5 pinned (kept for other TUI plugins, which is why it was installed withnpm install --forcein the first place).[email protected]accepts"@opentui/*": ">=0.4.2 <1", so 0.4.5 satisfies it and reify succeeds.Looks like the Bun reify in 2.1.4 fails the whole install when a peer dependency cannot be satisfied by the versions already in the config's
node_modules, instead of re-allocating the peer. Happy to test a@opentuibump if that helps isolate it.jgarrone82 commentedon Oct 26, 2026
Follow-up with concrete differentiating evidence on 2.1.4 / Windows 11:
opencode plugin add [email protected]→ exit 1, sameNpmInstallFailedError/unable to resolve dependency treeatNpm.reify.opencode plugin add [email protected]→ exit 1, same failure, on a config where its peers (@opencode-ai/plugin1.18.15,@opentui/*) were all satisfied.opencode plugin add [email protected]→ exit 0, both before and after any config changes.opencode-subagent-statusline: ^1.3.0dep frompackage.json→ still fails.@opentui/core/@opentui/solid0.4.5 → 0.5.17 → still fails, then rolled back.bun installwith the same package.json → OK (until consideration: opencode'sNpm.reifyuses@npmcli/arboristinside the compiled binary).@npmcli/arboristreify({add:[pkg]}, audit:false, ignoreScripts:true, binLinks:true, save:true)in a fresh staging dir with default config → OK for both packages.bun installin a scratch dir and pre-seeded an opencode cache generation at~/.cache/opencode/npm/[email protected]/<epoch-ms>/node_modules. After that,opencode plugin add [email protected]short-circuits the broken reify (active generation exists → metadata) and succeeds; on v2.1.4 the server loads the plugin fromdist/server.jsand reconciliation completes with 14 plugins and no errors.So on 2.1.4 the failure looks package-specific inside OpenCode's arborist call (engram-manage vs statusline differ in the reify outcome under identical config/registry), not purely spec-shape-specific. Hope that helps; happy to run the same package pair on any debug build.
opencode-agent commentedon Oct 27, 2026
Closing this as a duplicate of #50080, since nobody has replied in the past day to say how it's different. #50080 covers the same failure:
opencode-sdd-engram-manageas a bare name or@latestfails withNpmInstallFailedError(unable to resolve dependency treeatNpm.reify) and stops reconciliation on every start, while system npm installs it fine.Until it's fixed, pinning an exact version (e.g.
[email protected]) is the reported workaround. Please follow #50080 for updates. A short comment there saying it still happens on 2.1.4 on Windows would help. If an exact version also fails for you, please reply here with the output and we can reopen. Thanks again for the thorough report!