Skip to content

v2026.5.2: each openclaw plugins install and openclaw doctor --fix wipes other previously-installed @openclaw/* packages from ~/.openclaw/npm/node_modules #76441

Description

@Wookie1

Environment

  • OpenClaw 2026.5.2 (8b2a6e5)
  • Raspberry Pi 5, Linux arm64, Node 22.22.2
  • Single-user gateway, systemd-managed

Symptom

Running openclaw plugins install <pkgB> after a prior openclaw plugins install <pkgA> removes pkgA's on-disk directory. The install record for pkgA remains in ~/.openclaw/plugins/installs.json, but ~/.openclaw/npm/node_modules/@openclaw/<pkgA> is gone. The gateway then can't load pkgA and emits Config warnings: plugins.entries.<pkgA>: plugin not found: <pkgA> (stale config entry ignored; remove it from plugins config). The same wipe happens on openclaw doctor --fix.

This makes it impossible to have more than one externally-installed @openclaw/* plugin via the CLI — each install resets to a single-plugin state.

Reproduction

Starting from a clean ~/.openclaw/npm/node_modules/@openclaw/ directory:

$ openclaw plugins install @openclaw/discord
Installed plugin: discord
$ ls ~/.openclaw/npm/node_modules/@openclaw/
discord

$ openclaw plugins install @openclaw/acpx@beta
Installed plugin: acpx
$ ls ~/.openclaw/npm/node_modules/@openclaw/
acpx                       # <-- discord is gone

$ openclaw doctor --fix
Updated ~/.openclaw/openclaw.json
$ ls ~/.openclaw/npm/node_modules/@openclaw/
discord                    # <-- acpx is gone

$ cat ~/.openclaw/plugins/installs.json | jq '.installRecords | keys'
[
  "acpx",
  "discord"                # <-- both records still tracked, but only one on disk
]

Likely root cause

~/.openclaw/npm/ has no package.json. openclaw plugins install appears to invoke npm install <pkg> (or equivalent) into that directory. With no package.json to anchor a dependency tree, npm treats every package other than the one you're installing as extraneous and removes it. Each subsequent install/repair therefore yields a single-package node_modules. openclaw doctor --fix repeats the same pattern when reconciling the install records.

Workaround

Manually maintain a package.json at ~/.openclaw/npm/ that lists every installed @openclaw/* plugin as a dependency, then run npm install directly:

$ cat > ~/.openclaw/npm/package.json << 'EOF'
{
  "name": "openclaw-plugins-install-root",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "@openclaw/discord": "2026.5.2",
    "@openclaw/acpx": "2026.5.2-beta.2"
  }
}
EOF
$ cd ~/.openclaw/npm && npm install
$ openclaw plugins enable acpx
$ systemctl --user restart openclaw-gateway.service

After this, both packages coexist and the gateway boots with the full plugin set. The workaround obviously breaks the next time anything calls openclaw plugins install or openclaw doctor --fix, since they presumably overwrite or ignore this package.json.

Suggested fix directions

  1. Have openclaw plugins install maintain a package.json (or equivalent dep manifest) in ~/.openclaw/npm/ that reflects all rows in installs.json before running the npm operation, so the targeted package is added but the others stay in the dep tree.
  2. Or invoke npm with --no-package-lock and --prefer-offline against a synthesized dep tree that includes every previously-installed plugin, so npm doesn't see anything as extraneous.
  3. Or stop using a shared ~/.openclaw/npm/node_modules/ for multi-plugin installs, and instead install each plugin into its own directory keyed off the install record.

Related issues

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