Developers
Homebrew or npm downloads fail on a Mac
Homebrew downloads with curl and Git. npm downloads from its registry. Each tool reads its own proxy and certificate settings.
Symptoms
brew installstops with “curl: (28) … timed out” or “Failed to download resource”.npm installstops with ETIMEDOUT, ECONNRESET or a certificate error.- Downloads fail on a company network or VPN only.
- Downloads start and then stop on a slow connection.
Likely causes
- A proxy that the tool does not know. Homebrew uses
http_proxy,https_proxyandall_proxy. npm uses itsproxyandhttps-proxysettings or the same variables. - TLS inspection. A company proxy signs traffic with its own certificate. See Corporate proxy certificates break Terminal tools on a Mac.
- A wrong npm registry. An old
registrysetting can point to a server that you cannot reach. - A slow or metered connection. Large downloads can time out on a weak Wi-Fi or a hotspot.
How to check
Let Homebrew check your system.
brew doctorShow the Homebrew and system configuration.
brew configShow npm's registry and proxy settings.
npm config get registry npm config get proxy npm config get https-proxyAsk the npm registry for a reply.
npm pingTest the download host directly with curl.
curl -v -o /dev/null https://formulae.brew.sh/api/formula.json
How to fix it
For Homebrew behind a proxy, set the proxy variable in the same shell.
export https_proxy=http://proxy.example.com:8080For npm behind a proxy, set the npm proxy.
npm config set https-proxy http://proxy.example.com:8080Remove an old npm registry setting so npm uses its default.
npm config delete registryLet Homebrew try a failed download more times.
export HOMEBREW_CURL_RETRIES=5If your company uses a mirror, set it. Homebrew uses
HOMEBREW_BOTTLE_DOMAINandHOMEBREW_API_DOMAINfor mirrors.For certificate errors, add the company root certificate. See Corporate proxy certificates break Terminal tools on a Mac.
With Kilobat
Before a big install, check whether the network is metered, on a VPN or slow.
kilobat conditionsFind the layer that stops the download host. Add
--appto use the proxy variables of that process.kilobat why https://ghcr.io/v2/homebrew/core --app process:curlKeep the Mac awake while the install runs.
kilobat awake -- brew upgradeThese commands are free. See Check the network before a big download in an agent.
Questions
Does Homebrew use the System Settings proxy?
Homebrew's documentation lists proxy variables for curl, Git and Subversion. Set https_proxy in your shell.
How long does npm wait?
npm's documentation gives a default fetch-timeout of 300000 ms, five minutes, and 2 fetch-retries.
Sources
- Homebrew Docs: Manpage, environment variables
- npm Docs: config
- curl(1), man page installed with macOS 27.2
Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.