-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
Extensions with dependencies fail to load when installed via pnpm (missing node_modules) #26762
Description
Bug
Extensions that declare their own dependencies in extensions/<name>/package.json fail to load when OpenClaw is installed via pnpm (global or otherwise), because pnpm does not recursively run npm install inside nested sub-packages.
Reproduction
pnpm add -g [email protected]
# Enable matrix in openclaw.json
openclaw gateway restartGateway log:
[plugins] matrix failed to load from .../openclaw/extensions/matrix/index.ts:
Error: Cannot find module '@vector-im/matrix-bot-sdk'
Root Cause
The published openclaw package includes extensions/<name>/package.json with dependencies, but those sub-package node_modules/ directories are not populated. Neither pnpm nor npm recursively install nested package.json files — only the top-level package.json dependency tree is resolved.
This likely works in the development workspace (monorepo/workspaces), but the published tarball does not include the extension node_modules/ and has no postinstall hook to install them.
Affected Extensions (2026.2.24)
Every bundled extension with external dependencies is affected. Of 13 extensions with deps, all 13 ship without their node_modules:
| Extension | Missing Dependencies |
|---|---|
| matrix | @vector-im/matrix-bot-sdk, @matrix-org/matrix-sdk-crypto-nodejs, markdown-it, music-metadata, zod |
| diagnostics-otel | 11 @opentelemetry/* packages |
| feishu | @larksuiteoapi/node-sdk, @sinclair/typebox, zod |
| googlechat | google-auth-library |
| memory-lancedb | @lancedb/lancedb, @sinclair/typebox, openai |
| msteams | @microsoft/agents-hosting, express |
| nostr | nostr-tools, zod |
| synology-chat | zod |
| tlon | @urbit/aura |
| twitch | @twurple/api, @twurple/auth, @twurple/chat, zod |
| voice-call | @sinclair/typebox, ws, zod |
| zalo | undici |
| zalouser | @sinclair/typebox |
Extensions without external dependencies (e.g., telegram, discord, signal, slack, whatsapp, imessage, irc) are unaffected.
Workaround
Manually run npm install inside each affected extension directory:
cd "$(pnpm root -g)/openclaw/extensions/matrix"
npm installThis breaks on every pnpm update since the store contents are replaced.
Suggested Fix
A few options (not mutually exclusive):
- Bundle
node_modulesin the published tarball — ensure the npm publish step includes extension deps - Add a
postinstallhook — runnpm installin each extension subdirectory that has apackage.jsonwith dependencies - Hoist extension deps — move them to the top-level
package.jsonas optional dependencies so any package manager resolves them - Lazy install on enable — have
openclaw plugins enable <name>or gateway startup check/install missing deps automatically
Option 3 or 4 seems most robust across package managers.
Environment
- openclaw 2026.2.24
- pnpm 10.6.2
- macOS 26.3 (arm64)
- Node v24.13.0