Skip to content
Latchkey

Electron "Failed to download" the Electron binary in CI

electron's postinstall downloads a large platform-specific zip from GitHub releases. In CI a network hiccup, rate limit, or blocked mirror makes that fetch fail and the install aborts.

What this error means

npm install fails inside the electron postinstall with "Error: Failed to download" or "RequestError: connect ETIMEDOUT", referencing a github.com release URL.

node
Error: Failed to download electron-v31.0.0-linux-x64.zip
  RequestError: connect ETIMEDOUT 140.82.121.4:443
    at ClientRequest.<anonymous> (.../got/dist/source/core/index.js)

Common causes

Transient network failure or GitHub rate limit

The default download host is GitHub releases; a momentary timeout or an anonymous rate limit drops the transfer mid-download.

A blocked or slow mirror

A corporate proxy or a misconfigured ELECTRON_MIRROR cannot serve the zip, so got retries and then fails.

How to fix it

Cache and reuse the Electron download

Persist the electron download cache across runs so the binary is fetched once, not on every job.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.cache/electron
    key: electron-${{ hashFiles('package-lock.json') }}

Point at a reliable mirror

Set ELECTRON_MIRROR to a fast, reachable host when GitHub is rate limited or blocked.

.github/workflows/ci.yml
env:
  ELECTRON_MIRROR: https://npmmirror.com/mirrors/electron/

How to prevent it

  • Cache ~/.cache/electron keyed on the lockfile.
  • Configure a stable ELECTRON_MIRROR for your region.
  • Authenticate GitHub requests to avoid anonymous rate limits.

Frequently asked questions

What causes ""Failed to download" Electron"?
The default download host is GitHub releases; a momentary timeout or an anonymous rate limit drops the transfer mid-download.
How do I fix "Failed to download" Electron?
Persist the electron download cache across runs so the binary is fetched once, not on every job.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card