cacheport

Error · npm

Fixing npm ERR! code E429 Too Many Requests

The registry answered, but refused the request because too many requests came from the same client or address in a short time. npm reports the HTTP status 429 as E429.

What you see

build log
npm ERR! code E429
npm ERR! 429 Too Many Requests - GET https://registry.npmjs.org/@babel%2fcore

Common causes

  • Many runners sharing one public IP address through NAT, so the registry sees them as one very busy client.
  • Matrix builds that install the same dependencies in dozens of jobs at once.
  • Scripts that call npm view or npm outdated in loops.

How to fix it

  1. 01

    Spread the load

    Reduce parallel installs, or install once and share node_modules between jobs as an artifact.

    shell
    npm ci --prefer-offline
  2. 02

    Use one cache for every runner

    A registry cache turns hundreds of runners into one well-behaved client upstream.

    .npmrc
    registry=https://acme.cacheport.cc/npm/
    //acme.cacheport.cc/npm/:_authToken=${CACHEPORT_TOKEN}

Other network failures in builds

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.