{"record":{"id":"ada2d67a4f07f2fc","repo":"yarnpkg/yarn","slug":"unknown-registry-resolver-0","errorCode":null,"errorMessage":"Unknown registry resolver $0","messagePattern":"Unknown registry resolver \\$0","errorType":"exception","errorClass":"MessageError","httpStatus":null,"severity":"error","filePath":"src/package-request.js","lineNumber":143,"sourceCode":"      if (!(err instanceof MessageError) && this.parentRequest && this.parentRequest.pattern) {\n        throw new MessageError(\n          this.reporter.lang('requiredPackageNotFoundRegistry', pattern, this.parentRequest.pattern, this.registry),\n        );\n      }\n      throw err;\n    }\n  }\n\n  /**\n   * Get the registry resolver associated with this package request.\n   */\n\n  getRegistryResolver(): Function {\n    const Resolver = registryResolvers[this.registry];\n    if (Resolver) {\n      return Resolver;\n    } else {\n      throw new MessageError(this.reporter.lang('unknownRegistryResolver', this.registry));\n    }\n  }\n\n  async normalizeRange(pattern: string): Promise<string> {\n    if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || getExoticResolver(pattern)) {\n      return pattern;\n    }\n\n    if (!semver.validRange(pattern)) {\n      try {\n        if (await fs.exists(path.join(this.config.cwd, pattern, constants.NODE_PACKAGE_JSON))) {\n          this.reporter.warn(this.reporter.lang('implicitFileDeprecated', pattern));\n          return `file:${pattern}`;\n        }\n      } catch (err) {\n        // pass\n      }\n    }","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/package-request.js#L125-L161","documentation":"Thrown by PackageRequest.getRegistryResolver() when registryResolvers[this.registry] is undefined. Yarn maintains a map of registry names to resolver classes; if a package's registry string has no registered resolver, it cannot proceed with resolution. This is a lookup-table miss, not a network error.","triggerScenarios":"A package manifest or lockfile sets _registry to a string with no entry in registryResolvers (e.g., a typo or unknown registry type). Called from getRegistryResolver() during the resolution pipeline.","commonSituations":"Misconfigured .yarnrc/.npmrc with a non-standard registry name; lockfiles from a newer Yarn referencing registries an older version doesn't know; custom plugin/registry that wasn't registered.","solutions":["Verify the registry name in .yarnrc/.npmrc matches a known resolver (typically 'npm')","Check package._registry fields in yarn.lock for unknown registry strings","Delete yarn.lock and run yarn install to regenerate with the correct registry references","Ensure any custom registry resolver plugin is properly loaded before resolution"],"exampleFix":"// before (.yarnrc)\nregistry \"mycustomreg\"\n// after\nregistry \"npm\"","handlingStrategy":"validation","validationCode":"const KNOWN_REGISTRIES = Object.keys(registryResolvers);\nif (!KNOWN_REGISTRIES.includes(pkg._registry)) {\n  throw new Error(`Registry '${pkg._registry}' has no resolver. Known: ${KNOWN_REGISTRIES.join(', ')}`);\n}","typeGuard":"function isKnownRegistry(registry: string): boolean {\n  return Object.prototype.hasOwnProperty.call(registryResolvers, registry);\n}","tryCatchPattern":"try {\n  const Resolver = request.getRegistryResolver();\n} catch (e) {\n  if (e.message.includes('Unknown registry resolver')) {\n    // log and fall back to the default npm registry\n  }\n}","preventionTips":["Validate registry names against the resolver map before resolution","Keep .yarnrc registry configuration limited to known types","Regenerate lockfiles when upgrading Yarn versions"],"tags":["registry","configuration","resolver"],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}