Skip to content
Latchkey

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".

ng
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

  1. Install the package that provides the schematic as a devDependency.
  2. Use the correct schematic name from that collection.
  3. Avoid running repo-mutating ng add in build/test pipelines.
Terminal
npm install --save-dev @schematics/angular
npx ng generate component user-card

Keep 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →