angular/angular-cli · error · SchematicsException
Project "${options.project}" does not exist.
Error message
Project "${options.project}" does not exist. What it means
The project-targeting schematic factory wrapper resolves the named project from the workspace configuration before invoking the schematic. If `options.project` is not a key in workspace.projects, it throws this SchematicsException instead of proceeding with an undefined project.
Source
Thrown at packages/schematics/angular/utility/project.ts:36
* @returns A schematic rule factory.
*/
export function createProjectSchematic<S extends { project: string }>(
factory: (
options: S,
projectContext: {
project: ProjectDefinition;
workspace: WorkspaceDefinition;
tree: Tree;
context: SchematicContext;
},
) => Rule | Promise<Rule>,
): (options: S) => Rule {
return (options) => async (tree, context) => {
const workspace = await getWorkspace(tree);
const project = workspace.projects.get(options.project);
if (!project) {
throw new SchematicsException(`Project "${options.project}" does not exist.`);
}
return factory(options, { project, workspace, tree, context });
};
}
View on GitHub (pinned to bb72145f9a)
Solutions
- List valid projects with `ng list` or read `workspace.projects` in angular.json, then pass the exact name via --project.
- Fix typos in the --project flag.
- Re-add the missing project entry to angular.json if it was accidentally removed.
Example fix
// before ng g c header --project=myap // after ng g c header --project=myapp
Defensive patterns
Strategy: validation
Validate before calling
const ws = JSON.parse(fs.readFileSync('angular.json', 'utf8'));
if (!(options.project in ws.projects)) {
throw new Error(`Unknown project '${options.project}'. Known: ${Object.keys(ws.projects).join(', ')}`);
} Prevention
- Run `ng list` to confirm project names before scripted generation.
- Update CI scripts when renaming or removing projects.
- Use variables derived from angular.json instead of hard-coded project names.
When it happens
Trigger: Running any project-scoped schematic (`ng g c/d/p/m`, `ng add`, app-shell, config) with `--project name` where `name` is misspelled or was removed from angular.json / workspace config.
Common situations: CI scripts referencing a renamed project; deleted libraries still referenced by generation scripts; typos like `--project=my-app-e2e` when the e2e target was removed; multi-project monorepos with stale automation.
Related errors
- Option "project" is required.
- Specified module '${options.module}' does not exist.\nLooked
- More than one module matches. Use the '--skip-import' option
- Could not find a non Routing NgModule.\nModules with suffix
- Could not find (/.angular.json)
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/b2ac376b98ae81a7.
Report an issue: GitHub.