{"record":{"id":"6fc6980f669fb413","repo":"angular/angular-cli","slug":"an-unexpected-error-happened-package-name-has","errorCode":null,"errorMessage":"An unexpected error happened; package ${name} has no version ${installedVersion}.","messagePattern":"An unexpected error happened; package (.+?) has no version (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/update/update-resolver.ts","lineNumber":498,"sourceCode":"\n  if (!installedVersion) {\n    installedVersion = (await getSatisfyingVersion(\n      registryClient,\n      npmPackageJson,\n      packageJsonRange,\n    )) as VersionRange | undefined;\n  }\n\n  if (!installedVersion) {\n    throw new Error(\n      `An unexpected error happened; could not determine version for package ${name}.`,\n    );\n  }\n\n  const installedPackageJson =\n    localPkgJson || (await registryClient.getManifest(name, installedVersion));\n  if (!installedPackageJson) {\n    throw new Error(\n      `An unexpected error happened; package ${name} has no version ${installedVersion}.`,\n    );\n  }\n\n  let targetVersion: VersionRange | undefined = packages.get(name);\n  if (targetVersion) {\n    const distTags = npmPackageJson['dist-tags'] ?? {};\n    let resolvedVersion: string | undefined =\n      distTags[targetVersion] ?? (targetVersion === 'next' ? distTags['latest'] : undefined);\n\n    if (\n      resolvedVersion &&\n      !isReleaseAgeSatisfied(registryClient, npmPackageJson, resolvedVersion)\n    ) {\n      resolvedVersion = undefined;\n    }\n\n    if (resolvedVersion) {","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/update/update-resolver.ts#L480-L516","documentation":"Thrown by _buildPackageInfo when the version recorded as installed for a package could not be resolved to an actual manifest: the local package.json was absent and the registry returned no manifest for name@installedVersion. This indicates inconsistent state between what the CLI believes is installed and what exists.","triggerScenarios":"Registry client getManifest(name, installedVersion) returns null/undefined because the version does not exist in the registry (yanked/unpublished version, private registry missing the package); local package.json missing while a cached installed version string was used.","commonSituations":"Package unpublished or replaced after local install; offline or corporate proxy blocking registry access; private npm registry not configured (.npmrc) so the manifest lookup fails.","solutions":["Check network/registry access and .npmrc configuration, then retry.","Reinstall the package so a local package.json exists (npm install <pkg>).","Confirm the installed version still exists on the registry (npm view <pkg> versions).","Update the lockfile: delete it and reinstall to resolve to an existing version."],"exampleFix":"// before\nng update @angular/core  // local manifest missing, registry lookup failed\n// after\nnpm install @angular/core\nng update @angular/core","handlingStrategy":"validation","validationCode":"const { stdout } = execSync(`npm view ${name}@${version} version`, { encoding: 'utf8' });\nif (!stdout.trim()) throw new Error(`${name}@${version} does not exist in the registry`);","typeGuard":null,"tryCatchPattern":"try {\n  await ngUpdate([name]);\n} catch (e) {\n  if (String(e.message).includes('has no version')) {\n    // reinstall the package to resync local state with the registry, then retry\n  }\n}","preventionTips":["Verify the installed version still exists on the registry (unpublished versions cause this).","Ensure .npmrc points at a registry that actually serves your dependencies.","Keep node_modules and the lockfile in sync with package.json.","Check network/proxy availability before running updates."],"tags":["angular-cli","registry","manifest","update"],"backgroundTag":"package-manifest-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}