openclaw - 💡(How to fix) Fix openclaw update uses system npm instead of active Linuxbrew npm, targets /usr/lib/node_modules [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61857Fetched 2026-04-08 02:53:28
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

openclaw update resolves the wrong npm in a mixed Linuxbrew + system-npm environment.

The active OpenClaw installation, Node, and npm all come from Linuxbrew, but openclaw update spawns system npm instead and attempts to install into /usr/lib/node_modules/openclaw, which fails with EACCES.

Root Cause

Notes / suspected root cause

Fix Action

Fix / Workaround

Workaround: /home/linuxbrew/.linuxbrew/bin/npm install -g openclaw@latest

Code Example

which openclaw
# /home/linuxbrew/.linuxbrew/bin/openclaw

which npm
# /home/linuxbrew/.linuxbrew/bin/npm

npm root -g
# /home/linuxbrew/.linuxbrew/lib/node_modules

openclaw update

---

EACCES: permission denied, mkdir '/usr/lib/node_modules/openclaw'

---

/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/...
npm v10.9.4
path /usr/lib/node_modules/openclaw

---

/home/linuxbrew/.linuxbrew/lib/node_modules/openclaw
RAW_BUFFERClick to expand / collapse

Summary

openclaw update resolves the wrong npm in a mixed Linuxbrew + system-npm environment.

The active OpenClaw installation, Node, and npm all come from Linuxbrew, but openclaw update spawns system npm instead and attempts to install into /usr/lib/node_modules/openclaw, which fails with EACCES.

Environment

  • OpenClaw: 2026.4.2
  • Active binary: /home/linuxbrew/.linuxbrew/bin/openclaw
  • Active node: /home/linuxbrew/.linuxbrew/Cellar/node/25.6.1/bin/node
  • Active npm: /home/linuxbrew/.linuxbrew/bin/npm (v11.9.0)
  • System npm: /usr/bin/npm (v10.9.4)
  • OS: Ubuntu (Hetzner VPS)

Reproduction

which openclaw
# /home/linuxbrew/.linuxbrew/bin/openclaw

which npm
# /home/linuxbrew/.linuxbrew/bin/npm

npm root -g
# /home/linuxbrew/.linuxbrew/lib/node_modules

openclaw update

Actual result

openclaw update fails with:

EACCES: permission denied, mkdir '/usr/lib/node_modules/openclaw'

npm debug log shows the update subprocess uses system npm (v10.9.4) instead of Linuxbrew npm (v11.9.0):

/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/...
npm v10.9.4
path /usr/lib/node_modules/openclaw

Expected result

openclaw update should use the npm associated with the active OpenClaw installation (Linuxbrew npm) and update under:

/home/linuxbrew/.linuxbrew/lib/node_modules/openclaw

Notes / suspected root cause

The update code resolves package manager commands via bare command names ("npm", "pnpm") in:

  • detectGlobalInstallManagerForRoot(...)
  • resolveGlobalRoot(...)
  • resolveGlobalPackageRoot(...)
  • globalInstallArgs(...)

This allows the update subprocess to drift to system npm even though the running OpenClaw binary, node, and npm are all from Linuxbrew.

Relevant dist files:

  • dist/server-startup-matrix-migration-BAUV8BrW.js
  • dist/openclaw-root-Q4UoS1xk.js

The package root detection itself (resolveOpenClawPackageRoot) appears correct; the mismatch happens later during global manager/root verification and install command execution.

Workaround: /home/linuxbrew/.linuxbrew/bin/npm install -g openclaw@latest

extent analysis

TL;DR

The most likely fix is to modify the openclaw update command to use the Linuxbrew npm instead of the system npm.

Guidance

  • Verify that the openclaw and npm binaries are correctly resolved to the Linuxbrew versions using which openclaw and which npm.
  • Check the detectGlobalInstallManagerForRoot, resolveGlobalRoot, resolveGlobalPackageRoot, and globalInstallArgs functions to ensure they are resolving the correct package manager.
  • Consider modifying the openclaw update command to explicitly use the Linuxbrew npm, such as by setting the npm executable path or using the full path to the Linuxbrew npm binary.
  • As a temporary workaround, use the provided command /home/linuxbrew/.linuxbrew/bin/npm install -g openclaw@latest to update OpenClaw.

Example

No code snippet is provided as the issue does not require a code change, but rather a modification to the openclaw update command or the underlying package manager resolution.

Notes

The issue is specific to the interaction between OpenClaw, Linuxbrew, and system npm, and may not be applicable to other environments or package managers.

Recommendation

Apply the workaround by using the command /home/linuxbrew/.linuxbrew/bin/npm install -g openclaw@latest to update OpenClaw, as this ensures the correct npm version is used.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING