pnpm peer-dependency warnings on dsh plugin add: which are safe to ignore and how to fix the rest #3101
Replies: 3 comments 1 reply
The distinction between “missing from the profile workspace” and “actually unavailable at runtime” is probably the key here.Since the host intentionally provides these peers, I wonder if the cleaner long-term fix would be to make that host/profile dependency boundary explicit rather than relying on pnpm warnings being understood as benign. pnpm already has mechanisms like For The |
|
你的 Finding 1-3 我对照当前 main HEAD 当前 main 上的两条路径:
所以手动加的
如果确实能稳定复现"字段消失",值得单独开一帖带最小复现(哪个命令、哪个文件、前后 diff)——因为按当前源码路径,这个问题看起来不在 dsh 侧,别让维护者追一个不存在的写入点。 |
|
The key classification is “missing from the profile workspace” versus “unavailable or incompatible at runtime.” In rc.7, the profile deliberately uses I would apply four checks to every warning independently:
For the build-policy detail, follow the installed pnpm/DSH diagnostic rather than copying a generic list: rc.7’s Git-plugin path explicitly tells the user to add the exact identity pnpm printed under Also confirmed from source: I turned this into a source-linked warning router and 12-gate install checklist here: https://sandbaseai.github.io/deepseek-harness-handbook/plugin-peer-warnings.html |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Symptom
Running
dsh plugin --profile web add <plugin>makes pnpm print a long list of✕ missing peerwarnings (@deepseek-ai/cordis,@deepseek-ai/dsh-*,react-dom, etc.), plus anIgnored build scriptsnotice at the end. It looks like a broken install, but most of these warnings are by design — only a couple of items actually need fixing. Posting my findings for anyone who runs into the same output.Finding 1: most missing-peer warnings are by design and safe to ignore
The profile directory (e.g.
~/.dsh/profiles/web) deliberately setsautoInstallPeers: falsein itspnpm-workspace.yaml. These peers are provided by the dsh host one level up, in~/.dsh/profiles/node_modules— verified versions there:@deepseek-ai/cordis4.0.1 (satisfies^4.0.1)react/react-dom18.3.1 (satisfies^18.2.0)dsh-llm/dsh-tools/dsh-agent/dsh-client-*etc., all at 0.1.0-rc.6At runtime, plugins resolve them through Node's upward node_modules lookup and share the host's singletons. Do not install these packages into the profile just to silence the warnings — that creates duplicate cordis / dsh-tools instances, which is exactly the root cause of the tool-scheduling crashes in #1849 and #2731. pnpm only looks inside the profile workspace and can't see the host's packages one level up, so the warnings will always appear.
Finding 2: the only real conflict is
@xterm/addon-web-links— fixable with an overridedsh-plugin-terminal@0.1.13pins@xterm/addon-web-linksto0.11.0, which declares a peer on@xterm/xterm@^5.0.0, while the plugin itself bundles@xterm/xterm@^6.0.0(hence theunmet peerwarning).@xterm/addon-web-links@0.12.0is the release built for xterm 6 and no longer declares that peer. Add to the profile'spnpm-workspace.yaml:Then run
pnpm installin that directory — the conflict warning is gone.Finding 3: authorize the ignored build scripts via onlyBuiltDependencies
The build scripts of
node-pty,ssh2,cpu-features, andcloudflaredare blocked by pnpm's default policy, but the terminal/ssh plugins need them. Also inpnpm-workspace.yaml:After reinstalling, ssh2's crypto binding compiles successfully, and node-pty (via prebuilds) was verified working with a real spawned process.
Remaining issue (not fixable from the profile side)
@deepseek-ai/dsh-settings@0.1.0-rc.7(a dependency ofdsh-sight@0.3.1) expectsdsh-brand/dsh-invariants@^0.1.0-rc.7, while the host currently ships rc.6, which doesn't satisfy that range. Runtime injection by the host generally still works, but if dsh-sight misbehaves, the likely cause is the host lagging behind — we can only wait for a host upgrade.Two suggestions
dsh plugin add) could note that missing-peer warnings for host-provided packages are normal, or offer a way to suppress them, to avoid confusion.dsh plugin add/removemay rewritepnpm-workspace.yamland drop the manually addedoverrides/onlyBuiltDependenciessections. It would be more robust if the CLI preserved unknown fields or offered a profile-level pnpm config entry point.Environment: pnpm 10.33.0, Node 22, macOS arm64.
All reactions