{"record":{"id":"476ceac3a41edf0b","repo":"angular/angular-cli","slug":"unable-to-load-package-information-from-registry","errorCode":null,"errorMessage":"Unable to load package information from registry: ${e.message}","messagePattern":"Unable to load package information from registry: (.+?)","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/add/cli.ts","lineNumber":379,"sourceCode":"    // Attempt to use the 'latest' tag from the registry.\n    try {\n      const latestManifest = await packageManager.getManifest(`${packageName}@latest`, {\n        registry,\n      });\n\n      if (latestManifest) {\n        const conflicts = await this.getPeerDependencyConflicts(latestManifest);\n        if (!conflicts) {\n          context.packageIdentifier = npa.resolve(latestManifest.name, latestManifest.version);\n          task.output = `Found compatible package version: ${color.blue(latestManifest.version)}.`;\n\n          return;\n        }\n        rejectionReasons.push(...conflicts);\n      }\n    } catch (e) {\n      assertIsError(e);\n      throw new CommandError(`Unable to load package information from registry: ${e.message}`);\n    }\n\n    // 'latest' is invalid or not found, search for most recent matching package.\n    task.output =\n      'Could not find a compatible version with `latest`. Searching for a compatible version.';\n\n    let packageMetadata;\n    try {\n      packageMetadata = await packageManager.getRegistryMetadata(packageName, {\n        registry,\n      });\n    } catch (e) {\n      assertIsError(e);\n      throw new CommandError(`Unable to load package information from registry: ${e.message}`);\n    }\n\n    if (!packageMetadata) {\n      throw new CommandError('Unable to load package information from registry.');","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/add/cli.ts#L361-L397","documentation":"In findCompatiblePackageVersionTask, after 'latest' metadata was fetched, any further failure while resolving a compatible version is caught, run through assertIsError, and rethrown as a CommandError 'Unable to load package information from registry: <e.message>'. It surfaces registry/network/package-not-found failures during the 'ng add' version-resolution task.","triggerScenarios":"During 'ng add', the version-resolution task fails while querying the registry for versions of a package whose 'latest' was invalid or not found — network failure, 404 for a nonexistent package name, private package without auth, or a custom registry being unreachable.","commonSituations":"Typo in the package name passed to 'ng add'; installing an @scope/private package without registry auth tokens; offline or corporate proxy blocking registry.npmjs.org; --registry pointing to a mirror that lacks the package.","solutions":["Fix the underlying cause shown in e.message — verify the package name is spelled correctly and exists on the configured registry.","Check network/VPN/proxy settings and confirm 'npm view <package>' works with the same registry.","For private packages, configure auth (NPM_TOKEN / .npmrc authToken) for the scope's registry.","Retry if the error was transient (429/5xx from the registry), or pin a concrete version: 'ng add @scope/pkg@1.2.3'."],"exampleFix":"// before\nng add @anguler/localize\n\n// after (correct name)\nng add @angular/localize","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`${registry.replace(/\\/$/, '')}/${packageName.replace('/', '%2F')}`);\nif (!res.ok) {\n  throw new Error(`Package '${packageName}' not reachable on ${registry} (HTTP ${res.status})`);\n}","typeGuard":"function isAggregateOrPlainError(e: unknown): e is Error {\n  return e instanceof Error;\n}","tryCatchPattern":"try {\n  await ngAdd(packageName, { registry });\n} catch (e) {\n  if (String(e.message).startsWith('Unable to load package information from registry')) {\n    // check package name, network, and registry auth, then retry\n  } else { throw e; }\n}","preventionTips":["Verify package existence with 'npm view <name>' before ng add.","Keep connectivity to the registry (VPN/proxy/firewall) verified in CI.","Configure auth tokens for private scopes before running ng add.","Catch transient 429/5xx and retry with backoff."],"tags":["angular-cli","ng-add","npm-registry","network"],"backgroundTag":"registry-metadata-unavailable","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}