#19941: fix(nostr): move openclaw from devDependencies to peerDependencies
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
#11454: fix(plugins): remove workspace:* from extension dependencies
by AnonO6 · 2026-02-07
88.5%
#8500: fix: Remove workspace:* from devDependencies in voice-call plugin
by ImBIOS · 2026-02-04
86.9%
#20055: fix(plugins): strip workspace:* dev-deps before npm install
by openperf · 2026-02-18
86.1%
#16140: fix: convert installable extension deps from workspace:* to peerDep...
by battman21 · 2026-02-14
81.8%
#20360: fix(feishu): remove workspace protocol from published package metadata
by tanujbhaud · 2026-02-18
81.3%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
79.6%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
78.5%
#22692: fix(memory-lancedb): [P1] add missing runtime deps — plugin broken ...
by mahsumaktas · 2026-02-21
78.3%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
78.2%
#23337: fix: move @discordjs/opus to optionalDependencies [AI-assisted 🤖]
by davidmckenzie · 2026-02-22
76.1%