{"record":{"id":"c98745aad5d2009b","repo":"yarnpkg/yarn","slug":"packagenotfoundregistry-c98745","errorCode":null,"errorMessage":"packageNotFoundRegistry","messagePattern":"packageNotFoundRegistry","errorType":"exception","errorClass":"MessageError","httpStatus":null,"severity":"error","filePath":"src/resolvers/registries/npm-resolver.js","lineNumber":188,"sourceCode":"            _remote.integrity = ssri.fromHex(_remote.hash, 'sha1').toString();\n          }\n        }\n      }\n    }\n    if (\n      shrunk &&\n      shrunk._remote &&\n      (shrunk._remote.integrity || this.config.offline || !this.config.autoAddIntegrity)\n    ) {\n      // if the integrity field does not exist, we're not network-restricted, and the\n      // migration hasn't been disabled, it needs to be created\n      return shrunk;\n    }\n\n    const desiredVersion = shrunk && shrunk.version ? shrunk.version : null;\n    const info: ?Manifest = await this.resolveRequest(desiredVersion);\n    if (info == null) {\n      throw new MessageError(this.reporter.lang('packageNotFoundRegistry', this.name, NPM_REGISTRY_ID));\n    }\n\n    const {deprecated, dist} = info;\n    if (shrunk && shrunk._remote) {\n      shrunk._remote.integrity =\n        dist && dist.integrity\n          ? ssri.parse(dist.integrity)\n          : ssri.fromHex(dist && dist.shasum ? dist.shasum : '', 'sha1');\n      return shrunk;\n    }\n\n    if (typeof deprecated === 'string') {\n      let human = `${info.name}@${info.version}`;\n      const parentNames = this.request.parentNames;\n      if (parentNames.length) {\n        human = parentNames.concat(human).join(' > ');\n      }\n      this.reporter.warn(`${human}: ${deprecated}`);","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/resolvers/registries/npm-resolver.js#L170-L206","documentation":"When resolveRequest returns null (no manifest found online or offline after all attempts), Yarn cannot find the package in the registry and throws packageNotFoundRegistry. This is the terminal failure after every resolution path is exhausted.","triggerScenarios":"A package name that does not exist in the configured registry, or auth failure causes resolveRequest to return null. Throws right after `if (info == null)`.","commonSituations":"Typo in package name; private/scoped package without auth; unpublished package; wrong registry scope configured.","solutions":["Verify the package name is spelled correctly and published (npm view <name>)","Ensure auth tokens are configured for private/scoped packages (npm config set //registry/.../:_authToken)","Check the registry URL in .npmrc/.yarnrc is correct for the scope","If unpublished, switch to an alternative or forked package"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm the package exists and is reachable before resolving\nconst exists = await registry.request(escapedName, {});\nif (!exists) {\n  throw new Error(`Package ${name} not found; check name, scope, and auth`);\n}","typeGuard":"function isResolvablePackage(info: object | null): boolean {\n  return info != null && typeof info === 'object';\n}","tryCatchPattern":"try {\n  const manifest = await resolver.resolveRequest(desiredVersion);\n} catch (e) {\n  if (e.message.includes('packageNotFoundRegistry')) {\n    // correct the package name or configure auth, then retry\n  }\n}","preventionTips":["Verify package names with npm view before adding","Configure auth tokens for private/scoped registries","Validate .npmrc registry URLs per scope"],"tags":["registry","package-not-found","resolution"],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}