{"record":{"id":"577f6825ea8f48e8","repo":"denoland/deno","slug":"package-not-found-in-catalog","errorCode":null,"errorMessage":"Package '{}' not found in catalog","messagePattern":"Package '(.+?)' not found in catalog","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/args/mod.rs","lineNumber":504,"sourceCode":"                sub_path.as_deref(),\n                Some(cwd),\n                node_resolver::ResolutionMode::Import,\n                node_resolver::NodeResolutionKind::Execution,\n              )?\n              .into_url()?\n          }\n          deno_package_json::PackageJsonDepValue::Catalog(catalog_name) => {\n            match self\n              .workspace_resolver\n              .resolve_catalog_dep(alias, catalog_name)\n            {\n              Some(req) => ModuleSpecifier::parse(&format!(\n                \"npm:{}{}\",\n                req,\n                sub_path.map(|s| format!(\"/{}\", s)).unwrap_or_default()\n              ))?,\n              None => {\n                return Err(deno_core::anyhow::anyhow!(\n                  \"Package '{}' not found in catalog\",\n                  alias\n                ));\n              }\n            }\n          }\n        }\n      }\n      deno_resolver::workspace::MappedResolution::PackageJsonImport {\n        pkg_json,\n      } => self\n        .node_resolver\n        .resolve_package_import(\n          specifier,\n          Some(&node_resolver::UrlOrPathRef::from_url(cwd)),\n          Some(pkg_json),\n          node_resolver::ResolutionMode::Import,\n          node_resolver::NodeResolutionKind::Execution,","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/args/mod.rs#L486-L522","documentation":"cli/args/mod.rs:504 fires during specifier resolution when a package.json dependency uses a catalog reference (deno_package_json::PackageJsonDepValue::Catalog, i.e. \"pkg\": \"catalog:\" or \"catalog:<name>\") but workspace_resolver.resolve_catalog_dep(alias, catalog_name) finds no matching catalog entry in the workspace's deno.json. The resolver therefore cannot turn the alias into a concrete npm:version specifier and aborts with this anyhow error.","triggerScenarios":"A package.json dependency like \"chalk\": \"catalog:\" while the root deno.json has no \"catalog\"/\"catalogs\" block defining chalk; a named catalog \"catalog:jsr\" that was never declared; running the script from outside the workspace so the deno.json defining catalogs is never discovered.","commonSituations":"Adopting Deno workspace catalogs after `deno add --catalog` in the wrong workspace root; teammates on older Deno versions that don't read catalogs; renaming a catalog in deno.json but leaving package.json references behind; monorepo members whose nearest deno.json lacks the inherited catalog.","solutions":["Add the package to the catalog in the workspace-root deno.json: \"catalog\": { \"chalk\": \"^5.3.0\" } (or \"catalogs\": { \"default\": { ... } })","Verify the catalog name matches exactly — \"catalog:jsr\" requires a \"catalogs\": { \"jsr\": { ... } } entry; bare \"catalog:\" maps to the default catalog","Run `deno install` from the workspace root so the root deno.json is discovered, and upgrade Deno to a version supporting catalogs","As a last resort, pin the dependency directly in package.json (\"chalk\": \"^5.3.0\") to drop the catalog indirection"],"exampleFix":"// before -- package.json\n\"dependencies\": { \"chalk\": \"catalog:\" }\n// (root deno.json has no catalog)\n\n// after -- root denzo.json adds:\n{\n  \"catalog\": { \"chalk\": \"^5.3.0\" }\n}","handlingStrategy":"validation","validationCode":"// Node script: verify every catalog ref resolves before running deno\nimport { readFileSync } from \"node:fs\";\nconst pkg = JSON.parse(readFileSync(\"package.json\", \"utf8\"));\nconst deno = JSON.parse(readFileSync(\"deno.json\", \"utf8\"));\nconst catalog = deno.catalog ?? Object.values(deno.catalogs ?? {})[0] ?? {};\nfor (const [dep, spec] of Object.entries({ ...pkg.dependencies, ...pkg.devDependencies })) {\n  if (typeof spec === \"string\" && spec.startsWith(\"catalog:\") && !(dep in catalog)) {\n    console.error(`MISSING CATALOG ENTRY for ${dep}`);\n    process.exitCode = 1;\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer `deno add <pkg>` to edit package.json/deno.json so catalog entries stay in sync","CI step: run `deno install --entrypoint` (or deno cache) on every workspace member to fail fast on unresolvable catalogs","Keep catalog definitions only in the workspace-root deno.json and reference them from member package.json files"],"tags":["npm","workspace","catalog","package-json"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}