{"record":{"id":"af0d73c6602a0978","repo":"withastro/astro","slug":"unable-to-fetch-integration-does-the-package-e","errorCode":null,"errorMessage":"Unable to fetch ${integration}. Does the package exist?","messagePattern":"Unable to fetch (.+?)\\. Does the package exist\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/astro/src/cli/add/index.ts","lineNumber":891,"sourceCode":"\t\t\t\t\t\t\t\t`No problem! Find our official integrations at ${cyan(\n\t\t\t\t\t\t\t\t\t'https://astro.build/integrations',\n\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspinner.message('Resolving with third party packages...');\n\t\t\t\t\t\tpkgType = 'third-party';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpkgType = 'first-party';\n\t\t\t\t\t\tpkgJson = firstPartyPkgCheck as any;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pkgType === 'third-party') {\n\t\t\t\t\tconst thirdPartyPkgCheck = await fetchPackageJson(scope, name, tag);\n\t\t\t\t\tif (thirdPartyPkgCheck instanceof Error) {\n\t\t\t\t\t\tif (thirdPartyPkgCheck.message) {\n\t\t\t\t\t\t\tspinner.message(yellow(thirdPartyPkgCheck.message));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new Error(`Unable to fetch ${bold(integration)}. Does the package exist?`);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpkgJson = thirdPartyPkgCheck as any;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst resolvedScope = pkgType === 'first-party' ? '@astrojs' : scope;\n\t\t\t\tconst packageName = `${resolvedScope ? `${resolvedScope}/` : ''}${name}`;\n\t\t\t\tlet integrationName = packageName;\n\t\t\t\tlet dependencies: IntegrationInfo['dependencies'] = [\n\t\t\t\t\t[pkgJson['name'], `^${pkgJson['version']}`],\n\t\t\t\t];\n\n\t\t\t\tif (pkgJson['peerDependencies']) {\n\t\t\t\t\tconst meta = pkgJson['peerDependenciesMeta'] || {};\n\t\t\t\t\tfor (const peer in pkgJson['peerDependencies']) {\n\t\t\t\t\t\tconst optional = meta[peer]?.optional || false;\n\t\t\t\t\t\tconst isAstro = peer === 'astro';\n\t\t\t\t\t\tif (!optional && !isAstro) {","sourceCodeStart":873,"sourceCodeEnd":909,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/cli/add/index.ts#L873-L909","documentation":"When the resolved package is third-party (scope is not @astrojs, or @astrojs lookup failed and the user chose to continue), `astro add` calls fetchPackageJson for that scope/name/tag. If that lookup returns an Error (registry lookup failed, package not found), `astro add` throws this Error. It indicates the package genuinely could not be located on the registry.","triggerScenarios":"Running `astro add @scope/nonexistent` or `astro add typoed-name` where the package does not exist on the npm registry (or the registry was unreachable during resolution). Reached in the third-party branch after the official-package check failed.","commonSituations":"Typo in the package name; private/unpublished package; registry downtime or network egress block; scoped package whose scope is correct but name is wrong; package was renamed/deprecated.","solutions":["Verify the package exists on npm: `npm view <pkg>` or search the registry.","Correct the spelling / scope and re-run `astro add`.","If you are behind a registry mirror/proxy, ensure npm/Astro can reach it (check .npmrc and network).","If the package is private, install it manually via your package manager instead of `astro add`."],"exampleFix":"# before\nastro add @astrojs/tailwnd   # name typo, lookup fails\n\n# after\nastro add @astrojs/tailwind","handlingStrategy":"validation","validationCode":"async function packageExists(name: string, tag = 'latest') {\n  const r = await fetch(`https://registry.npmjs.org/${encodeURIComponent(name)}/${tag}`);\n  return r.ok;\n}","typeGuard":"function isScopedName(v: unknown): v is string {\n  return typeof v === 'string' && /^@[^/]+\\//.test(v);\n}","tryCatchPattern":null,"preventionTips":["Run `npm view <pkg>` to confirm the package exists before `astro add`.","Ensure CI/build hosts can reach the npm registry.","Install private packages manually if `astro add` cannot resolve them."],"tags":["cli","astro-add","npm","network","registry"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}