Angular "Schematic X not found" / ng add failure in CI
ng generate and ng add resolve schematics from installed collections. In CI they fail when the collection package is not installed, when the schematic name is wrong, or when ng add is run in an automated pipeline that should not be mutating the repo.
What this error means
A step running ng generate or ng add fails with "Schematic 'X' not found in collection '@schematics/angular'" or "Collection ... cannot be resolved".
Error: Schematic "componentt" not found in collection "@schematics/angular".Common causes
The schematic collection is not installed
The collection package (for example a UI library schematics package) is not in node_modules, so the CLI cannot resolve the schematic.
A misspelled schematic or misuse of ng add in CI
A typo in the schematic name, or running interactive ng add in a pipeline that should build/test rather than scaffold.
How to fix it
Install the collection and use the exact name
- Install the package that provides the schematic as a devDependency.
- Use the correct schematic name from that collection.
- Avoid running repo-mutating ng add in build/test pipelines.
npm install --save-dev @schematics/angular
npx ng generate component user-cardKeep CI to build and test
Reserve ng add / scaffolding for local development; CI jobs should run npm ci, build, lint, and test rather than generate code.
How to prevent it
- Install schematic collections as devDependencies.
- Use exact schematic names from the collection.
- Do not scaffold with ng add inside build/test CI jobs.