pnpm/pnpm · error · PnpmError

CANNOT_RESOLVE_OVERRIDE_VERSION

CANNOT_RESOLVE_OVERRIDE_VERSION

Error message

Cannot resolve version ${spec} in overrides. The direct dependencies don't have dependency "${dependencyName}".

What it means

Error "Cannot resolve version ${spec} in overrides. The direct dependencies don't have dependency "${dependencyName}"." thrown in pnpm/pnpm.

Source

Thrown at pnpm11/config/reader/src/getOptionsFromRootManifest.ts:313

    'See https://pnpm.io/catalogs'
  )
}

function createVersionReferencesReplacer (manifest: ProjectManifest): (spec: string) => string {
  const allDeps = {
    ...manifest.devDependencies,
    ...manifest.dependencies,
    ...manifest.optionalDependencies,
  }
  return replaceVersionReferences.bind(null, allDeps)
}

function replaceVersionReferences (dep: Record<string, string>, spec: string): string {
  if (!(spec[0] === '$')) return spec
  const dependencyName = spec.slice(1)
  const newSpec = dep[dependencyName]
  if (newSpec) return newSpec
  throw new PnpmError(
    'CANNOT_RESOLVE_OVERRIDE_VERSION',
    `Cannot resolve version ${spec} in overrides. The direct dependencies don't have dependency "${dependencyName}".`
  )
}

View on GitHub (pinned to 5b11d3a15b)

When it happens

Trigger: Thrown at pnpm11/config/reader/src/getOptionsFromRootManifest.ts:313 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pnpm/pnpm@5b11d3a15b (2026-08-16). Data as JSON: /api/errors/67e484ed13f34cd9. Report an issue: GitHub.