Skip to content

Plugin runtime dependencies not properly staged after global npm install #67038

Description

@JIRBOY

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

  1. Global install completes successfully
  2. Dependencies are installed to npm/node_modules/openclaw/node_modules/ (root level)
  3. Individual plugin directories (dist/extensions/*/) do NOT have their own node_modules folders
  4. 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:

  1. 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/
  2. 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
  3. 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:

  1. Clone the OpenClaw repository
  2. Run pnpm install and pnpm build to build with proper staging
  3. Or use pnpm stage:bundled-plugin-runtime-deps after installation

Possible Solutions

  1. Option A: Update postinstall-bundled-plugins.mjs to also run the staging script for non-source checkouts
  2. Option B: Include stage-bundled-plugin-runtime-deps.mjs in the npm package and call it during postinstall
  3. Option C: Update openclaw doctor to check root node_modules as a fallback for missing plugin-level dependencies
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions