yarnpkg/yarn · error · Error

couldn't find ${name}

Error message

couldn't find ${name}

What it means

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.

Source

Thrown at src/registries/npm-registry.js:224

    const config = this.config;
    const requestParts = urlParts(requestUrl);
    return !!Object.keys(config).find(option => {
      const parts = option.split(':');
      if ((parts.length === 2 && parts[1] === '_authToken') || parts[1] === '_password') {
        const registryParts = urlParts(parts[0]);
        if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {
          return true;
        }
      }
      return false;
    });
  }

  async checkOutdated(config: Config, name: string, range: string): CheckOutdatedReturn {
    const escapedName = NpmRegistry.escapeName(name);
    const req = await this.request(escapedName, {unfiltered: true});
    if (!req) {
      throw new Error(`couldn't find ${name}`);
    }

    // By default use top level 'repository' and 'homepage' values
    let {repository, homepage} = req;
    const wantedPkg = await NpmResolver.findVersionInRegistryResponse(config, escapedName, range, req);

    // But some local repositories like Verdaccio do not return 'repository' nor 'homepage'
    // in top level data structure, so we fallback to wanted package manifest
    if (!repository && !homepage) {
      repository = wantedPkg.repository;
      homepage = wantedPkg.homepage;
    }

    let latest = req['dist-tags'].latest;
    // In certain cases, registries do not return a 'latest' tag.
    if (!latest) {
      latest = wantedPkg.version;
    }

View on GitHub (pinned to c2dda503f3)

Solutions

  1. Verify the package name is spelled correctly and still published (npm view <name>)
  2. Ensure auth tokens are configured for private/scoped packages
  3. Switch to the canonical npm registry if using a lagging mirror
  4. Remove the package from package.json if it has been unpublished
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check package existence before calling checkOutdated
const exists = await registry.request(escapedName, {unfiltered: true});
if (!exists) {
  console.warn(`Package ${name} not found in registry; skipping outdated check`);
}

Type guard

function hasRegistryEntry(response: object | null): boolean {
  return response != null && typeof response === 'object';
}

Try / catch

try {
  await npmRegistry.checkOutdated(config, name, range);
} catch (e) {
  if (e.message.includes("couldn't find")) {
    // skip this package in the outdated report
  }
}

Prevention

When it happens

Trigger: yarn outdated or upgrade-interactive for a package whose registry request returns null/empty. The `if (!req)` guard fires.

Common situations: Package was unpublished or renamed; private package requiring missing auth; registry mirror without the package; typo in package name.

Related errors


AI-assisted analysis of yarnpkg/yarn@c2dda503f3 (2026-08-13). Data as JSON: /api/errors/03f85e6aef9927c2. Report an issue: GitHub.