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 openclaw@2026.2.24
# Enable matrix in openclaw.json
openclaw gateway restart
Gateway 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 install
This breaks on every pnpm update since the store contents are replaced.
Suggested Fix
A few options (not mutually exclusive):
- Bundle
node_modules in the published tarball — ensure the npm publish step includes extension deps
- Add a
postinstall hook — run npm install in each extension subdirectory that has a package.json with dependencies
- Hoist extension deps — move them to the top-level
package.json as 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
Bug
Extensions that declare their own
dependenciesinextensions/<name>/package.jsonfail to load when OpenClaw is installed viapnpm(global or otherwise), because pnpm does not recursively runnpm installinside nested sub-packages.Reproduction
pnpm add -g openclaw@2026.2.24 # Enable matrix in openclaw.json openclaw gateway restartGateway log:
Root Cause
The published openclaw package includes
extensions/<name>/package.jsonwith dependencies, but those sub-packagenode_modules/directories are not populated. Neither pnpm nor npm recursively install nestedpackage.jsonfiles — only the top-levelpackage.jsondependency 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 nopostinstallhook 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:@vector-im/matrix-bot-sdk,@matrix-org/matrix-sdk-crypto-nodejs,markdown-it,music-metadata,zod@opentelemetry/*packages@larksuiteoapi/node-sdk,@sinclair/typebox,zodgoogle-auth-library@lancedb/lancedb,@sinclair/typebox,openai@microsoft/agents-hosting,expressnostr-tools,zodzod@urbit/aura@twurple/api,@twurple/auth,@twurple/chat,zod@sinclair/typebox,ws,zodundici@sinclair/typeboxExtensions without external dependencies (e.g., telegram, discord, signal, slack, whatsapp, imessage, irc) are unaffected.
Workaround
Manually run
npm installinside each affected extension directory:This breaks on every
pnpm updatesince the store contents are replaced.Suggested Fix
A few options (not mutually exclusive):
node_modulesin the published tarball — ensure the npm publish step includes extension depspostinstallhook — runnpm installin each extension subdirectory that has apackage.jsonwith dependenciespackage.jsonas optional dependencies so any package manager resolves themopenclaw plugins enable <name>or gateway startup check/install missing deps automaticallyOption 3 or 4 seems most robust across package managers.
Environment