hermes - 💡(How to fix) Fix [Bug]: Desktop update fails on macOS with "Backend updated, but the desktop rebuild failed" (EAGAIN in npm ci postinstall)

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…

On macOS, clicking "Update" in the Hermes Desktop app (or running hermes desktop --build-only) triggers npm ci from the repo root to install workspace dependencies. During this install, the postinstall script for electron-winstaller (a Windows-only dependency of electron-builder) spawns a child process via sh -c node ./script/select-7z-arch.js which fails with EAGAIN ("Resource temporarily unavailable").

The same error can also affect agent-browser's postinstall script.

Error Message

The same error can also affect agent-browser's postinstall script.

Root Cause

The npm ci command in _run_npm_install_deterministic (in hermes_cli/main.py) runs all package lifecycle scripts. On macOS, spawning sh from a Node.js postinstall script can hit macOS process resource limits, producing EAGAIN. The failure is deterministic for electron-winstaller because it always tries to run its select-7z-arch.js script on install.

Fix Action

Fix

PR #39845 modifies _run_npm_install_deterministic to detect install-script failures in stderr (by matching patterns like info run, EAGAIN+spawn, ERR!+script) and retry once with --ignore-scripts. This is safe because electron-builder handles native-module rebuilding independently during its own packaging step.

Code Example

Backend updated, but the desktop rebuild failed. Restart Hermes to retry.
RAW_BUFFERClick to expand / collapse

Description

On macOS, clicking "Update" in the Hermes Desktop app (or running hermes desktop --build-only) triggers npm ci from the repo root to install workspace dependencies. During this install, the postinstall script for electron-winstaller (a Windows-only dependency of electron-builder) spawns a child process via sh -c node ./script/select-7z-arch.js which fails with EAGAIN ("Resource temporarily unavailable").

The same error can also affect agent-browser's postinstall script.

Impact

The npm ci step fails, which causes the desktop GUI rebuild to abort. The user sees:

Backend updated, but the desktop rebuild failed. Restart Hermes to retry.

The Python backend has been updated (git pull + pip install succeeded), but the Electron .app was never rebuilt. The user is stuck in a broken state until they manually rebuild from the terminal.

Root Cause

The npm ci command in _run_npm_install_deterministic (in hermes_cli/main.py) runs all package lifecycle scripts. On macOS, spawning sh from a Node.js postinstall script can hit macOS process resource limits, producing EAGAIN. The failure is deterministic for electron-winstaller because it always tries to run its select-7z-arch.js script on install.

Fix

PR #39845 modifies _run_npm_install_deterministic to detect install-script failures in stderr (by matching patterns like info run, EAGAIN+spawn, ERR!+script) and retry once with --ignore-scripts. This is safe because electron-builder handles native-module rebuilding independently during its own packaging step.

Environment

  • macOS (any version)
  • Hermes Desktop (any local or source build)
  • Node.js via Hermes-managed install

Related

  • PR #39845

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