{"record":{"id":"062d16a76e222fc1","repo":"vercel/next.js","slug":"failed-to-fetch-registry-info-for-pkg-got-stat","errorCode":null,"errorMessage":"Failed to fetch registry info for ${pkg}, got status ${res.status}","messagePattern":"Failed to fetch registry info for (.+?), got status (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/patch-incorrect-lockfile.ts","lineNumber":17,"sourceCode":"import { readFileSync, writeFileSync } from 'fs'\nimport * as Log from '../build/output/log'\nimport findUp from 'next/dist/compiled/find-up'\n// @ts-ignore no-json types\nimport { optionalDependencies as nextOptionalDeps } from 'next/package.json'\nimport type { UnwrapPromise } from './coalesced-function'\nimport { isCI } from '../server/ci-info'\nimport { getRegistry } from './helpers/get-registry'\n\nlet registry: string | undefined\n\nasync function fetchPkgInfo(pkg: string) {\n  if (!registry) registry = getRegistry()\n  const res = await fetch(`${registry}${pkg}`)\n\n  if (!res.ok) {\n    throw new Error(\n      `Failed to fetch registry info for ${pkg}, got status ${res.status}`\n    )\n  }\n  const data = await res.json()\n  const versionData = data.versions[process.env.__NEXT_VERSION as string]\n\n  return {\n    os: versionData.os,\n    cpu: versionData.cpu,\n    engines: versionData.engines,\n    tarball: versionData.dist.tarball,\n    integrity: versionData.dist.integrity,\n  }\n}\n\n/**\n * Attempts to patch npm package-lock.json when it\n * fails to include optionalDependencies for other platforms","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/patch-incorrect-lockfile.ts#L1-L35","documentation":"Registry lookup failure in fetchPkgInfo while checking optional SWC dependency versions for lockfile correction: the HTTP fetch of `${registry}${pkg}` returned a non-ok status. The registry URL comes from getRegistry(), so misconfigured registries or unavailable packages produce this error.","triggerScenarios":"Fetching package registry metadata to patch a lockfile returns an error status.","commonSituations":"Registry is unreachable or rate-limited while Next.js verifies lockfile correctness.","solutions":["Check network/registry availability and retry the install so the lockfile can be patched."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}