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.
RequestError: Error: read ECONNRESET (downloading electron-v.../electron-...zip)
Electron failed to install correctly, please delete node_modules/electron and try installing againWhy 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:
- Re-run the install to retry the download.
- Cache the Electron download cache (
ELECTRON_CACHE) between runs. - Point
ELECTRON_MIRRORat an internal mirror to stabilize the fetch.
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.