Bun install registry network / connection error in CI
Bun opened a connection to the registry but the download timed out or the connection dropped mid-transfer. This is typically transient network flakiness rather than a bad request or bad auth.
What this error means
bun install fails with a connection or timeout error against the registry host, and a retry on the same job or a re-run often succeeds.
Terminal
bun install
error: ConnectionRefused downloading https://registry.npmjs.org/react
error: Failed to installCommon causes
Transient network slowness or a dropped connection
A slow mirror, momentary packet loss, or a large tarball makes the download stall or the socket drop before completion.
A flaky or rate-limited registry mirror
The configured registry returns intermittent errors or throttles the runner, so some downloads fail while others succeed.
How to fix it
Retry the install and cache the store
- Re-run the install; transient drops usually clear on retry.
- Cache
~/.bun/install/cacheso already-downloaded packages are reused. - Point at a reliable registry mirror for your region.
.github/workflows/ci.yml
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ hashFiles('bun.lockb') }}
- run: bun install --frozen-lockfileSet the registry explicitly
Pin a known-good registry in bunfig.toml so Bun does not fall back to a flaky mirror.
bunfig.toml
[install]
registry = "https://registry.npmjs.org/"How to prevent it
- Cache the Bun install cache to avoid re-downloading on flakes.
- Pin a reliable registry in bunfig.toml.
- Retry install on transient network errors.
Related guides
Bun install 401 from a private registry (bunfig.toml token) in CIFix Bun install 401/403 from a private registry in CI - the request reached the registry but the token in bun…
Bun install cache corrupt / stale in CIFix Bun install cache problems in CI - a corrupt or stale global install cache makes bun install fail or reso…
Bun "error: Failed to install ... failed to resolve" in CIFix Bun "error: Failed to install" / "failed to resolve" in CI - Bun could not resolve a dependency version a…