openclaw - 💡(How to fix) Fix [Bug] 2026.4.24 gateway 启动后反复自动执行 npm install 形成死循环,降级到 4.21 正常 [2 comments, 3 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#72711Fetched 2026-04-28 06:33:08
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
0
Author
Timeline (top)
commented ×2closed ×1
RAW_BUFFERClick to expand / collapse

问题描述

升级到 `[email protected]` 后,gateway 每次启动都会在后台自动执行一次 `npm install`,安装所有渠道插件的运行时依赖(如 @anthropic-ai/sdk, @google/genai, playwright-core, pdfjs-dist 等共 30+ 个包)。该进程占用大量系统资源,在资源受限的机器上容易被 OOM Killer 强制终止,导致安装永远无法完成,下次 gateway 启动又会再次触发 → 形成死循环。

降级回 `[email protected]` 后,问题立即消失,不再出现任何自动安装行为。

复现步骤

  1. 安装或升级到 `[email protected]`
  2. 清理 `plugin-runtime-deps` 缓存:`rm -rf ~/.openclaw/plugin-runtime-deps`
  3. 运行 `openclaw doctor --fix` 并等待依赖安装完成(此时一切正常)
  4. 启动 gateway:`openclaw gateway start`
  5. 观察后台进程:`ps aux | grep "npm install"`,会看到一条长命令正在执行
  6. 即使依赖已完整安装,该进程仍会反复出现,无法通过等待或重试结束循环

已尝试的无效修复

  • 清空 `sessions`、`cron`、`plugin-runtime-deps` 目录
  • 使用软链接将 `openclaw-unknown-*` 目录指向正常版本目录
  • 禁用所有非必要插件,仅保留核心
  • 修改源码中的依赖安装函数(尚不清楚确切的触发点)
  • 使用 `NODE_OPTIONS="--max-old-space-size=256"` 降低内存占用

以上方法均无法阻止 gateway 触发新的 `npm install`,只有将版本回退到 `4.21` 彻底解决了问题。

正常版本

`[email protected]` – 启动 gateway 后无任何后台安装进程,一切功能正常。

环境信息

  • 操作系统: macOS
  • Node.js 版本: v22.22.2 (通过 nvm 管理)
  • OpenClaw 版本: 2026.4.24 – 问题版本
  • 配置文件: `~/.openclaw/openclaw.json`

初步分析

似乎是 `2026.4.24` 引入了某个插件依赖自动更新/自修复机制,该机制在 gateway 运行时会持续校验依赖版本或完整性,校验失败即尝试安装,但因环境或实现 Bug 导致即使安装成功也会再次触发,形成死循环。

期望修复

请开发团队检查 `2026.4.24` 中新增的依赖自管理逻辑,并提供修复版本,或指导如何通过配置彻底关闭此行为。临时方案:降级到 `4.21` 可保持稳定运行。

extent analysis

TL;DR

Downgrade to [email protected] to prevent the automatic npm install loop.

Guidance

  • Verify that the issue is specific to [email protected] by checking the installation process on other versions.
  • Investigate the changes in the 2026.4.24 version that may have introduced the automatic dependency update mechanism.
  • Check the ~/.openclaw/openclaw.json configuration file for any settings that could be contributing to the issue.
  • Consider setting up a test environment to reproduce the issue and test potential fixes without affecting the production system.

Notes

The root cause of the issue seems to be related to the new dependency self-management logic introduced in 2026.4.24. However, without more information about the specific changes made in this version, it's difficult to provide a more targeted fix.

Recommendation

Apply workaround: Downgrade to [email protected] to prevent the automatic npm install loop, as this version has been confirmed to be stable and free of the issue.

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

openclaw - 💡(How to fix) Fix [Bug] 2026.4.24 gateway 启动后反复自动执行 npm install 形成死循环,降级到 4.21 正常 [2 comments, 3 participants]