vercel/turborepo · warning
Could not find turbo in ${catalogName ? `catalog "${catalogN
Error message
Could not find turbo in ${catalogName ? `catalog "${catalogName}"` : "default catalog"} in ${catalogFile} What it means
In turbo-codemod's update-catalog step, after locating the catalog file it parses the YAML and reads `catalog.turbo` for a default reference or `catalogs.<name>.turbo` for a named one. If that key is absent the step warns and returns false, leaving the catalog's turbo entry unmodified — this migration step simply does not apply.
Source
Thrown at packages/turbo-codemod/src/commands/migrate/steps/update-catalog.ts:103
}: {
catalogInfo: CatalogInfo;
version: string;
}): boolean {
const { catalogFile, catalogName } = catalogInfo;
const content = fs.readFileSync(catalogFile, "utf8");
const doc = parseDocument(content);
// Path differs for default vs named catalogs:
// default: catalog.turbo
// named: catalogs.<name>.turbo
const yamlPath =
catalogName === null
? ["catalog", "turbo"]
: ["catalogs", catalogName, "turbo"];
const currentValue = doc.getIn(yamlPath) as string | undefined;
if (!currentValue) {
logger.warn(
`Could not find turbo in ${catalogName ? `catalog "${catalogName}"` : "default catalog"} in ${catalogFile}`
);
return false;
}
// Preserve the version range prefix (^, ~, >=, etc.)
const prefixMatch = currentValue.match(/^([^\d]*)/);
const prefix = prefixMatch ? prefixMatch[1] : "^";
const newValue = `${prefix}${version}`;
if (currentValue === newValue) {
return false;
}
doc.setIn(yamlPath, newValue);
fs.writeFileSync(catalogFile, doc.toString());
return true;View on GitHub (pinned to f9245100cf)
Solutions
- Add a turbo entry to the catalog in pnpm-workspace.yaml and re-run the codemod
- Fix the named catalog reference so it matches an existing `catalogs.<name>` block
- Check for typos between the specifier suffix and the YAML key
Example fix
# before: pnpm-workspace.yaml catalog: next: '^15.1.0' # package.json: "turbo": "catalog: # after: pnpm-workspace.yaml catalog: next: '^15.1.0' turbo: '^2.0.0'
Defensive patterns
Strategy: type-guard
Validate before calling
import { parseDocument } from 'yaml';
const doc = parseDocument(fs.readFileSync(catalogFile, 'utf8'));
const turbo = catalogName === null
? doc.getIn(['catalog', 'turbo'])
: doc.getIn(['catalogs', catalogName, 'turbo']);
if (!turbo) throw new Error('add a turbo entry to the catalog before migrating'); Type guard
type Workspace = { catalog?: Record<string, string>; catalogs?: Record<string, Record<string, string>> };
function hasTurboInCatalog(ws: unknown, name: string | null): ws is Workspace {
if (typeof ws !== 'object' || ws === null) return false;
const w = ws as Record<string, unknown>;
return name === null
? Boolean((w.catalog as Record<string, string> | undefined)?.turbo)
: Boolean((w.catalogs as Record<string, Record<string, string>> | undefined)?.[name]?.turbo);
} Prevention
- Keep a turbo entry present in every catalog that packages reference
- Mirror specifier names exactly: `catalog:web` requires `catalogs.web.turbo` to exist
- Re-run the codemod after fixing the YAML and confirm it now applies the version update
When it happens
Trigger: A package.json says `"turbo": "catalog:"` but the YAML `catalog:` block has no `turbo` key; or the specifier is `catalog:foo` while `catalogs.foo` exists but lacks a `turbo` entry (currentValue from doc.getIn is undefined).
Common situations: Catalog defined for other dependencies but turbo not yet added; a named-catalog typo (`catalog:web` vs a `catalogs: webx` key); partial catalog adoption across the monorepo.
Related errors
- Found catalog reference but ${catalogFileName} does not exis
- package_manager-unexpected
- Cannot infer turbo version due to use of `catalog` protocol.
- Invalid version: ${version}
- New workspace root detected - unexpected pnpm-workspace.yaml
AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17).
Data as JSON: /api/errors/e4449998b10cf013.
Report an issue: GitHub.