{"record":{"id":"05ed136ef4735f54","repo":"yarnpkg/yarn","slug":"requestfailed","errorCode":null,"errorMessage":"requestFailed","messagePattern":"requestFailed","errorType":"http","errorClass":"ResponseError","httpStatus":null,"severity":"error","filePath":"src/util/request-manager.js","lineNumber":430,"sourceCode":"    };\n\n    if (!params.process) {\n      const parts = url.parse(params.url);\n\n      params.callback = (err, res, body) => {\n        if (err) {\n          onError(err);\n          return;\n        }\n\n        successHosts[parts.hostname] = true;\n\n        this.reporter.verbose(this.reporter.lang('verboseRequestFinish', params.url, res.statusCode));\n\n        if (res.statusCode === 408 || res.statusCode >= 500) {\n          const description = `${res.statusCode} ${http.STATUS_CODES[res.statusCode]}`;\n          if (!queueForRetry(this.reporter.lang('internalServerErrorRetrying', description))) {\n            throw new ResponseError(this.reporter.lang('requestFailed', description), res.statusCode);\n          } else {\n            return;\n          }\n        }\n\n        if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') {\n          const message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`;\n          rejectWithoutUrl(new Error(this.reporter.lang('unauthorizedResponse', res.caseless.get('server'), message)));\n        }\n\n        if (res.statusCode === 401 && res.headers['www-authenticate']) {\n          const authMethods = res.headers['www-authenticate'].split(/,\\s*/).map(s => s.toLowerCase());\n\n          if (authMethods.indexOf('otp') !== -1) {\n            reject(new OneTimePasswordError());\n            return;\n          }\n        }","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/util/request-manager.js#L412-L448","documentation":"Error \"requestFailed\" thrown in yarnpkg/yarn.","triggerScenarios":"An HTTP request made by Yarn's request manager fails with an error status or network failure in src/util/request-manager.js.","commonSituations":"Occurs on registry timeouts, DNS failures, TLS errors, or 4xx/5xx responses while fetching package metadata or tarballs.","solutions":["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.","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.","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."],"exampleFix":"curl -I https://registry.yarnpkg.com  # confirm it returns 200, then rerun yarn install","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}