DeepSeek Harness ERR_PNPM_ADDING_TO_ROOT: pnpm version
"I configured nothing wrong — a fresh profile, one dsh plugin --profile wprobe add <tgz>, and it reports ERR_PNPM_ADDING_TO_ROOT" — the error looks like a broken plugin, but it is actually decided by the pnpm major version on your machine. dsh generates pnpm-workspace.yaml when initializing a profile, while the pnpm add it forwards carries no --workspace-root; pnpm 9 blocks it and pnpm 11 does not (#10629). Check the version first, then choose a path.
DeepSeek Harness: Step 1: check the pnpm major version
This is a version fork, so looking at whether pnpm on PATH is 9 or 11 is faster than reading any log.
- Run
pnpm --versionand note the major. - 9.x: a very high chance this is the issue.
- 11.x: the community comparison succeeded without
-w, so you are probably hitting something else. - If multiple pnpm installs exist (corepack, nvm, global), use
where pnpmorwhich pnpmto confirm which one actually runs. - When the version is unclear, run a minimal reproduction first instead of suspecting the plugin package.
DSH plugin: Step 2: inspect what the profile actually contains
A dsh-generated profile ships with its own workspace declaration, and that is what determines pnpm's behavior.
- Open
~/.dsh/profiles/<name>/(on Windows,C:\Users\<user>\.dsh\profiles\<name>). - Read
pnpm-workspace.yaml: it containspackages: - .,nodeLinker: hoisted, andautoInstallPeers: false. - Read
package.json: the name looks likedsh-profile-<name>, withprivate: trueand no dependencies. - So pnpm treats the profile directory as a workspace root.
- Meanwhile the actual command in the log is
pnpm add "<spec>", without-w. - Conclusion: dsh first creates a root, then installs into it with a command pnpm does not welcome at the root.
DeepSeek Harness: Step 3: three fixes, ordered by blast radius
Try the command-level bypass first, then configuration, and upstream code changes last.
- Command level: add
-wyourself, i.e.dsh plugin --profile <name> add -w <spec>; the community measured exit 0. - Configuration level: write an
.npmrcbesidepnpm-workspace.yamlwithignore-workspace-root-check=true. - Upstream level: have dsh automatically add
--workspace-rootwhen forwardingadd/remove; for a managed profile the profile is always the root, so the argument is always correct. - Another upstream option: stop generating
pnpm-workspace.yamlfor single-package profiles at all. - Whichever you choose, verify once by creating a clean profile and installing again, avoiding interference from old caches.
DSH Plugin: Controlled comparison: same layout, only the version changes
The community ran the cleanest single-variable comparison, and the conclusion is obvious.
| pnpm version | Passed -w? | Result |
|---|---|---|
| 9.15.9 | No | ERR_PNPM_ADDING_TO_ROOT, exit 1 |
| 9.15.9 | Yes | exit 0, installed |
| 11.28.5 | No | exit 0, installed |
The minimal reproduction is just as direct: use a tarball with no dependencies (to rule out dependency resolution), use a brand-new profile name so dsh creates the directory itself, then run dsh plugin --profile wprobe add D:\probe\dsh-probe-pkg-1.0.0.tgz.
DeepSeek Harness: What the scene looks like: terminal versus log
The terminal shows only a generic failure; the full command is in the log, and comparing the two confirms it.
# terminal
dsh: initialized profile wprobe at C:\Users\<user>\.dsh\profiles\wprobe
ERR_PNPM_ADDING_TO_ROOT Running this command will add the dependency to the workspace root ...
dsh: plugin command failed; diagnostics: ...\.plugin-manager\logs\operation-iVz9LN\pnpm.log
[exit code: 1]
# pnpm.log
Command failed with exit code 1: pnpm add "D:\probe\dsh-probe-pkg-1.0.0.tgz"
If pnpm add has no -w after it, cross-check pnpm --version and the case is basically closed.
DSH plugin: Why this error is especially hard to diagnose
The error contains no hint about the pnpm major version, leaving users unable to tell a version support problem from a plugin problem.
- The terminal shows only
dsh: plugin command failedand a log path. - The real command and error live in
.plugin-manager/logs/operation-*/pnpm.log. - The
ERR_PNPM_ADDING_TO_ROOTin the log is pnpm's wording and says nothing about dsh. - The result: when automation invokes this command, all it can surface is a generic failure.
- The community notes that a downstream project hit the same trap with a byte-identical symptom.
Should pnpm 9 count as supported?
The community has no verdict, but it affects you: if 9 is out of support, dsh should state the version requirement instead of throwing a pnpm internal error.
- Ask yourself whether other pnpm-dependent workflows already require 10+.
- If the team upgrades to pnpm 11 together, the problem disappears.
- If you must stay on pnpm 9, use the command-level or configuration-level bypass above.
- Either way, include
pnpm --versionin the failure report. - If upstream adopts it, the minimal change is adding
--workspace-rootwhen forwarding, plus a pnpm 9 regression test.
Cautions
Read the log command and the pnpm major before touching the plugin.
- Do not suspect the plugin package first. A dependency-free tarball fails the same way.
- Do not read only the terminal output. The real command is in
pnpm.log. - Do not delete
pnpm-workspace.yamlby hand. dsh maintains it and may regenerate it. - Do not test on the wrong profile. Reproduce with a brand-new profile name to rule out historical interference.
- Record the pnpm major version. It is the only basis for separating "compatibility defect" from "unsupported environment".
If your pnpm.log command already contains -w and still fails, this is not the issue — check the network source or package signature.See Fix "pnpm failed in profile directory" for DSH plugins for the related case.
FAQ
No, the plugin package is not broken: DeepSeek Harness generates pnpm-workspace.yaml (packages: - .) when initializing a profile, so pnpm treats the profile as a workspace root; the forwarded pnpm add does not include --workspace-root, and pnpm 9's workspace-root guard rejects it.
The outcome depends on which pnpm major version is on PATH for DeepSeek Harness. In the community comparison, pnpm 9.15.9 failed without -w and succeeded with it, while pnpm 11.28.5 succeeded without -w. This is a pnpm major-version dependency, not random environment flakiness.
The fastest workaround in DeepSeek Harness is to add -w yourself: dsh plugin --profile <name> add -w <package-or-tgz>, which the community measured as exit 0 with a successful install.
Yes, you can bypass it in DeepSeek Harness with configuration: write an .npmrc beside the generated pnpm-workspace.yaml with ignore-workspace-root-check=true. Alternatively upstream can add --workspace-root when forwarding, or stop generating a workspace file for single-package profiles.
To confirm this is the problem you hit in DeepSeek Harness, check whether the command in .plugin-manager/logs/operation-*/pnpm.log is pnpm add <spec> without -w, then check whether pnpm --version is 9.x. Both holding together is almost certainly this issue.
Related Terms
- ERR_PNPM_ADDING_TO_ROOT
- ERR_PNPM_ADDING_TO_ROOT is the error pnpm returns when add runs in a workspace root without an explicit declaration, asking for -w or --workspace-root. It means the target location is ambiguous, not that the package is broken.— https://github.com/deepseek-ai/deepseek-harness/discussions/10629
- pnpm-workspace.yaml
- pnpm's workspace declaration is `pnpm-workspace.yaml`: when present, that directory is treated as the workspace root. dsh generates it automatically for each profile, with a packages list and settings such as nodeLinker.— https://github.com/deepseek-ai/deepseek-harness/discussions/10629
- --workspace-root
- --workspace-root is a pnpm add argument that explicitly installs the dependency into the workspace root. In a dsh-managed profile the profile itself is the root, so the argument always applies.— https://github.com/deepseek-ai/deepseek-harness/discussions/10629
- managed profile
- A managed profile is a profile directory created and maintained by dsh, containing package.json, pnpm-workspace.yaml, and a lockfile. Plugin installation targets its package.json.— https://github.com/deepseek-ai/deepseek-harness/discussions/10629
Sources
- #10629 — dsh plugin add fails with ERR_PNPM_ADDING_TO_ROOT on a fresh profile (pnpm 9)· deepseek-ai (GitHub Discussions)
- deepseek-ai/deepseek-harness (source repository)· GitHub