{"record":{"id":"03f85e6aef9927c2","repo":"yarnpkg/yarn","slug":"couldn-t-find-name","errorCode":null,"errorMessage":"couldn't find ${name}","messagePattern":"couldn't find (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/registries/npm-registry.js","lineNumber":224,"sourceCode":"    const config = this.config;\n    const requestParts = urlParts(requestUrl);\n    return !!Object.keys(config).find(option => {\n      const parts = option.split(':');\n      if ((parts.length === 2 && parts[1] === '_authToken') || parts[1] === '_password') {\n        const registryParts = urlParts(parts[0]);\n        if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {\n          return true;\n        }\n      }\n      return false;\n    });\n  }\n\n  async checkOutdated(config: Config, name: string, range: string): CheckOutdatedReturn {\n    const escapedName = NpmRegistry.escapeName(name);\n    const req = await this.request(escapedName, {unfiltered: true});\n    if (!req) {\n      throw new Error(`couldn't find ${name}`);\n    }\n\n    // By default use top level 'repository' and 'homepage' values\n    let {repository, homepage} = req;\n    const wantedPkg = await NpmResolver.findVersionInRegistryResponse(config, escapedName, range, req);\n\n    // But some local repositories like Verdaccio do not return 'repository' nor 'homepage'\n    // in top level data structure, so we fallback to wanted package manifest\n    if (!repository && !homepage) {\n      repository = wantedPkg.repository;\n      homepage = wantedPkg.homepage;\n    }\n\n    let latest = req['dist-tags'].latest;\n    // In certain cases, registries do not return a 'latest' tag.\n    if (!latest) {\n      latest = wantedPkg.version;\n    }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/registries/npm-registry.js#L206-L242","documentation":"In checkOutdated(), the unfiltered registry request for a package returns a falsy value, meaning the registry returned no packument for the name. Without that data Yarn cannot compute outdated status.","triggerScenarios":"yarn outdated or upgrade-interactive for a package whose registry request returns null/empty. The `if (!req)` guard fires.","commonSituations":"Package was unpublished or renamed; private package requiring missing auth; registry mirror without the package; typo in package name.","solutions":["Verify the package name is spelled correctly and still published (npm view <name>)","Ensure auth tokens are configured for private/scoped packages","Switch to the canonical npm registry if using a lagging mirror","Remove the package from package.json if it has been unpublished"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check package existence before calling checkOutdated\nconst exists = await registry.request(escapedName, {unfiltered: true});\nif (!exists) {\n  console.warn(`Package ${name} not found in registry; skipping outdated check`);\n}","typeGuard":"function hasRegistryEntry(response: object | null): boolean {\n  return response != null && typeof response === 'object';\n}","tryCatchPattern":"try {\n  await npmRegistry.checkOutdated(config, name, range);\n} catch (e) {\n  if (e.message.includes(\"couldn't find\")) {\n    // skip this package in the outdated report\n  }\n}","preventionTips":["Verify package names exist before adding to dependencies","Keep auth tokens valid for private packages","Use the canonical registry to avoid mirror gaps"],"tags":["registry","outdated","network"],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}