← Back to PRs

#19941: fix(nostr): move openclaw from devDependencies to peerDependencies

by AustinEral open 2026-02-18 09:49 View on GitHub →
channel: nostr size: XS
## Summary `openclaw plugins install @openclaw/nostr` fails because `npm install` inside the extracted plugin directory chokes on `workspace:*` in `devDependencies`: ``` npm error code EUNSUPPORTEDPROTOCOL npm error Unsupported URL Type "workspace:": workspace:* ``` This happens because npm validates **all** dependency specifiers (including devDependencies) even when using `--omit=dev`. The `workspace:*` protocol is only valid inside a pnpm workspace context. ## Fix Move `openclaw` from `devDependencies` to `peerDependencies` with a concrete semver range (`>=2026.1.0`). This: - Avoids the `EUNSUPPORTEDPROTOCOL` error during plugin install - Matches guidance in AGENTS.md: *"put openclaw in devDependencies or peerDependencies instead (runtime resolves openclaw/plugin-sdk via jiti alias)"* - Aligns with how third-party plugins (e.g. openclaw-agent-reach) declare the dependency ## Reproduction ```bash # This fails: openclaw plugins install @openclaw/nostr # Underlying cause - npm install inside the plugin dir: cd ~/.openclaw/extensions/nostr npm install --omit=dev # Error: Unsupported URL Type "workspace:": workspace:* ``` ## Note This same issue affects **all extensions** that have `workspace:*` in devDependencies — not just nostr. A broader fix across all extensions would fully resolve #6879. Fixes #6879 --- 🤖 AI-assisted (Claude via OpenClaw). Fully understood and verified — tested npm install behavior with and without the workspace:* specifier. <!-- greptile_comment --> <h3>Greptile Summary</h3> Moves `openclaw` from `devDependencies` (with `workspace:*`) to `peerDependencies` (with `>=2026.1.0`) in the nostr extension's `package.json`, fixing `EUNSUPPORTEDPROTOCOL` errors when installing the plugin via `openclaw plugins install @openclaw/nostr`. - The root cause is confirmed: `npm install --omit=dev` (used in `src/infra/install-package-dir.ts:48`) validates all dependency specifiers including `devDependencies`, and `workspace:*` is only valid inside a pnpm workspace context. - This aligns with the guidance in `AGENTS.md` line 12: *"put `openclaw` in `devDependencies` or `peerDependencies` instead"*. - Note: ~30 other extensions under `extensions/` still have `"openclaw": "workspace:*"` in `devDependencies` and will exhibit the same failure. Even `googlechat` and `memory-core`, which already added `peerDependencies`, still retain the problematic `devDependencies` entry. A broader fix is needed to fully resolve the linked issue #6879. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge — it makes a minimal, well-understood change to a single package.json file that fixes a confirmed installation bug. - The change is a one-file metadata-only edit (package.json dependency section) with clear rationale, confirmed by the plugin install logic in src/infra/install-package-dir.ts. The semver range is reasonable, peerDependencies will resolve correctly in both workspace (development) and standalone (npm install) contexts, and the pattern is already established by googlechat and memory-core extensions. - No files require special attention. <sub>Last reviewed commit: 38eda62</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs