yarnpkg/yarn · error · ResponseError

requestFailed

Error message

requestFailed

What it means

Error "requestFailed" thrown in yarnpkg/yarn.

Source

Thrown at src/util/request-manager.js:430

    };

    if (!params.process) {
      const parts = url.parse(params.url);

      params.callback = (err, res, body) => {
        if (err) {
          onError(err);
          return;
        }

        successHosts[parts.hostname] = true;

        this.reporter.verbose(this.reporter.lang('verboseRequestFinish', params.url, res.statusCode));

        if (res.statusCode === 408 || res.statusCode >= 500) {
          const description = `${res.statusCode} ${http.STATUS_CODES[res.statusCode]}`;
          if (!queueForRetry(this.reporter.lang('internalServerErrorRetrying', description))) {
            throw new ResponseError(this.reporter.lang('requestFailed', description), res.statusCode);
          } else {
            return;
          }
        }

        if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') {
          const message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`;
          rejectWithoutUrl(new Error(this.reporter.lang('unauthorizedResponse', res.caseless.get('server'), message)));
        }

        if (res.statusCode === 401 && res.headers['www-authenticate']) {
          const authMethods = res.headers['www-authenticate'].split(/,\s*/).map(s => s.toLowerCase());

          if (authMethods.indexOf('otp') !== -1) {
            reject(new OneTimePasswordError());
            return;
          }
        }

View on GitHub (pinned to c2dda503f3)

Solutions

  1. The registry (or other HTTP endpoint) returned a 408 or 5xx status and all retries were exhausted. Check the status/availability of the registry (e.g. https://status.npmjs.org) and retry the command later.
  2. If you run a private registry or proxy, verify it is up and correctly configured; check --registry, proxy (http-proxy/https-proxy), and strict-ssl settings in .yarnrc / .npmrc.
  3. Test connectivity directly: curl -I <registry-url>. If the response is 5xx, fix the server; if a proxy interferes, adjust or unset the proxy config.

Example fix

curl -I https://registry.yarnpkg.com  # confirm it returns 200, then rerun yarn install

When it happens

Trigger: An HTTP request made by Yarn's request manager fails with an error status or network failure in src/util/request-manager.js.

Common situations: Occurs on registry timeouts, DNS failures, TLS errors, or 4xx/5xx responses while fetching package metadata or tarballs.


AI-assisted analysis of yarnpkg/yarn@c2dda503f3 (2026-08-13). Data as JSON: /api/errors/05ed136ef4735f54. Report an issue: GitHub.