Issue: Plugin runtime dependencies not properly staged after global npm install
Issue created for tracking - user reported plugin dependency issues with global npm installation
Summary
After installing OpenClaw via global npm (npm install -g openclaw), the openclaw doctor command reports many bundled plugins missing runtime dependencies, even though the dependencies are actually installed in the root node_modules directory.
Details
Expected Behavior
When running npm install -g openclaw, all bundled plugin runtime dependencies should be properly staged in their respective plugin directories (dist/extensions/*/node_modules/), or the openclaw doctor command should correctly detect that the dependencies are available from the root node_modules.
Actual Behavior
- Global install completes successfully
- Dependencies are installed to
npm/node_modules/openclaw/node_modules/ (root level)
- Individual plugin directories (
dist/extensions/*/) do NOT have their own node_modules folders
openclaw doctor reports missing dependencies like:
@aws-sdk/client-s3 (used by tlon)
@azure/identity (used by msteams)
@opentelemetry/* packages (used by diagnostics-otel)
@twurple/* packages (used by twitch)
acpx, zca-js, and others
Root Cause Analysis
The issue stems from the different dependency staging mechanisms:
-
Build-time staging (scripts/stage-bundled-plugin-runtime-deps.mjs):
- Only processes plugins with
"openclaw": { "bundle": { "stageRuntimeDependencies": true } } in their package.json
- Copies dependencies to
dist/extensions/*/node_modules/
-
Postinstall script (scripts/postinstall-bundled-plugins.mjs):
- Runs after global npm install
- Installs all plugin dependencies to the root
node_modules
- Does NOT create
node_modules in individual plugin directories
- This is the expected behavior for source checkouts, but not for pre-built npm packages
-
Doctor check:
- Looks for
node_modules in each plugin directory
- Fails for plugins that don't have the
stageRuntimeDependencies flag
Plugins Affected
Based on the openclaw doctor output, these plugins are missing their runtime dependencies after global install:
| Plugin |
Dependencies |
| tlon |
@aws-sdk/client-s3, @aws-sdk/s3-request-presigner, @tloncorp/tlon-skill, @urbit/aura |
| msteams |
@azure/identity, @microsoft/teams.api, @microsoft/teams.apps, jwks-rsa |
| diagnostics-otel |
@opentelemetry/api, @opentelemetry/api-logs, @opentelemetry/exporter-logs-otlp-proto, etc. |
| lobster |
@clawdbot/lobster |
| twitch |
@twurple/api, @twurple/auth, @twurple/chat |
| acpx |
acpx |
| zalouser |
zca-js |
| diffs |
@pierre/diffs, @pierre/theme (has flag but may still be affected) |
Workaround
For users experiencing this issue:
- Clone the OpenClaw repository
- Run
pnpm install and pnpm build to build with proper staging
- Or use
pnpm stage:bundled-plugin-runtime-deps after installation
Possible Solutions
- Option A: Update
postinstall-bundled-plugins.mjs to also run the staging script for non-source checkouts
- Option B: Include
stage-bundled-plugin-runtime-deps.mjs in the npm package and call it during postinstall
- Option C: Update
openclaw doctor to check root node_modules as a fallback for missing plugin-level dependencies
- Option D: Add
"stageRuntimeDependencies": true to more plugin package.json files
Environment
- OpenClaw version: 2026.4.14
- Install method: npm global (
npm install -g openclaw)
- OS: Windows 11 Enterprise
Issue: Plugin runtime dependencies not properly staged after global npm install
Issue created for tracking - user reported plugin dependency issues with global npm installation
Summary
After installing OpenClaw via global npm (
npm install -g openclaw), theopenclaw doctorcommand reports many bundled plugins missing runtime dependencies, even though the dependencies are actually installed in the rootnode_modulesdirectory.Details
Expected Behavior
When running
npm install -g openclaw, all bundled plugin runtime dependencies should be properly staged in their respective plugin directories (dist/extensions/*/node_modules/), or theopenclaw doctorcommand should correctly detect that the dependencies are available from the rootnode_modules.Actual Behavior
npm/node_modules/openclaw/node_modules/(root level)dist/extensions/*/) do NOT have their ownnode_modulesfoldersopenclaw doctorreports missing dependencies like:@aws-sdk/client-s3(used by tlon)@azure/identity(used by msteams)@opentelemetry/*packages (used by diagnostics-otel)@twurple/*packages (used by twitch)acpx,zca-js, and othersRoot Cause Analysis
The issue stems from the different dependency staging mechanisms:
Build-time staging (
scripts/stage-bundled-plugin-runtime-deps.mjs):"openclaw": { "bundle": { "stageRuntimeDependencies": true } }in theirpackage.jsondist/extensions/*/node_modules/Postinstall script (
scripts/postinstall-bundled-plugins.mjs):node_modulesnode_modulesin individual plugin directoriesDoctor check:
node_modulesin each plugin directorystageRuntimeDependenciesflagPlugins Affected
Based on the
openclaw doctoroutput, these plugins are missing their runtime dependencies after global install:Workaround
For users experiencing this issue:
pnpm installandpnpm buildto build with proper stagingpnpm stage:bundled-plugin-runtime-depsafter installationPossible Solutions
postinstall-bundled-plugins.mjsto also run the staging script for non-source checkoutsstage-bundled-plugin-runtime-deps.mjsin the npm package and call it during postinstallopenclaw doctorto check rootnode_modulesas a fallback for missing plugin-level dependencies"stageRuntimeDependencies": trueto more plugin package.json filesEnvironment
npm install -g openclaw)