Skip to content
Latchkey

Self-Healing CI: Auto-Retrying an Electron Download Timeout

An Electron install that times out downloading its binary hit a network blip on a large fetch, not a broken package -- the same download completes on a retry or from a cache.

The problem

An npm install fails because Electron timed out downloading its prebuilt binary archive. The version is valid and the asset exists; the large fetch hit a transient network problem. A human re-runs and Electron installs cleanly.

Typical symptom
RequestError: Error: read ECONNRESET (downloading electron-v.../electron-...zip)
Electron failed to install correctly, please delete node_modules/electron and try installing again

Why it happens

Electron downloads a large prebuilt binary archive during install, and a single big transfer is more exposed to a brief network blip or a momentary 5xx than a small request would be.

It is a transient fetch failure, not an install problem: the version is valid and the same archive downloads once the fetch is retried or served from a warmed cache.

The manual fix

Manual mitigations for an Electron download timeout:

  1. Re-run the install to retry the download.
  2. Cache the Electron download cache (ELECTRON_CACHE) between runs.
  3. Point ELECTRON_MIRROR at an internal mirror to stabilize the fetch.
Manual retry
npm ci   || (rm -rf node_modules/electron && sleep 5 && npm ci)

How this gets automated

An Electron download timeout has a recognizable transient signature -- a timeout or reset on a large fetch -- and the safe response is to retry, ideally from a cache. A self-healing CI pipeline detects the download failure, retries the install, and only escalates if the binary is genuinely unavailable across retries, distinguishing a blip from a real version or availability problem.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →