{"record":{"id":"c7a288bb8ad8f42c","repo":"angular/angular-cli","slug":"unknown-collection-name","errorCode":null,"errorMessage":"Unknown collection \"${name}\".","messagePattern":"Unknown collection \"(.+?)\"\\.","errorType":"exception","errorClass":"UnknownCollectionException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/schematics/src/engine/engine.ts","lineNumber":218,"sourceCode":"    }\n\n    const [description, bases] = this._createCollectionDescription(name, requester?.description);\n\n    collection = new CollectionImpl<CollectionT, SchematicT>(description, this, bases);\n    this._collectionCache.set(name, collection);\n    this._schematicCache.set(collection, new Map());\n\n    return collection;\n  }\n\n  private _createCollectionDescription(\n    name: string,\n    requester?: CollectionDescription<CollectionT>,\n    parentNames?: Set<string>,\n  ): [CollectionDescription<CollectionT>, Array<CollectionDescription<CollectionT>>] {\n    const description = this._host.createCollectionDescription(name, requester);\n    if (!description) {\n      throw new UnknownCollectionException(name);\n    }\n    if (parentNames && parentNames.has(description.name)) {\n      throw new CircularCollectionException(name);\n    }\n\n    const bases = new Array<CollectionDescription<CollectionT>>();\n    if (description.extends) {\n      parentNames = (parentNames || new Set<string>()).add(description.name);\n      for (const baseName of description.extends) {\n        const [base, baseBases] = this._createCollectionDescription(\n          baseName,\n          description,\n          new Set(parentNames),\n        );\n\n        bases.unshift(base, ...baseBases);\n      }\n    }","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/schematics/src/engine/engine.ts#L200-L236","documentation":"When the engine builds a collection description it delegates to the host's createCollectionDescription; if the host cannot resolve the named collection it returns null and the engine throws UnknownCollectionException. Collections are resolved through registered collection hosts (e.g. node modules with a collection.json), so the name must match an installed, registered collection.","triggerScenarios":"executeSchematic / createCollection called with a collection name that no registered host can resolve — wrong name string, collection package not installed, or its collection.json missing/not exported by its package.json `schematics` field.","commonSituations":"Running `ng generate` with a mistyped or uninstalled schematic collection; a devDependency missing in CI; a renamed package between versions; referencing `@schematics/angular` variants that aren't installed in a bare project.","solutions":["Install the collection package (e.g. `npm install --save-dev @schematics/angular`) and verify the exact name","Check the package's package.json `schematics` field points at its collection.json","Verify the custom collection host registers the collection before engine.execute","Pin versions consistent with your Angular CLI to avoid renamed/moved collections"],"exampleFix":"// before\nengine.createCollection('@angular/cdk/schematics'); // wrong name\n// after\nengine.createCollection('@angular/cdk'); // valid collection name, installed package","handlingStrategy":"try-catch","validationCode":"const name = '@schematics/angular';\ntry {\n  require.resolve(`${name}/collection.json`);\n} catch {\n  throw new Error(`Collection \"${name}\" is not installed; run npm install --save-dev ${name}.`);\n}","typeGuard":null,"tryCatchPattern":"import { UnknownCollectionException } from '@angular-devkit/schematics';\ntry {\n  engine.createCollection(name);\n} catch (err) {\n  if (err instanceof UnknownCollectionException) {\n    console.error(`Collection \"${name}\" not found. Is the package installed and its collection.json resolvable?`);\n  } else throw err;\n}","preventionTips":["Verify collection package names with npm ls / require.resolve before executing schematics","Add required schematic collections (e.g. @schematics/angular) to devDependencies so CI installs them","Confirm custom packages export collection.json via the package.json `schematics` field","Keep CLI and schematic package versions aligned"],"tags":["schematics","collection-resolution","angular-cli"],"backgroundTag":"unknown-collection","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}