{"record":{"id":"b2ac376b98ae81a7","repo":"angular/angular-cli","slug":"project-options-project-does-not-exist","errorCode":null,"errorMessage":"Project \"${options.project}\" does not exist.","messagePattern":"Project \"(.+?)\" does not exist\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/utility/project.ts","lineNumber":36,"sourceCode":" * @returns A schematic rule factory.\n */\nexport function createProjectSchematic<S extends { project: string }>(\n  factory: (\n    options: S,\n    projectContext: {\n      project: ProjectDefinition;\n      workspace: WorkspaceDefinition;\n      tree: Tree;\n      context: SchematicContext;\n    },\n  ) => Rule | Promise<Rule>,\n): (options: S) => Rule {\n  return (options) => async (tree, context) => {\n    const workspace = await getWorkspace(tree);\n    const project = workspace.projects.get(options.project);\n\n    if (!project) {\n      throw new SchematicsException(`Project \"${options.project}\" does not exist.`);\n    }\n\n    return factory(options, { project, workspace, tree, context });\n  };\n}\n","sourceCodeStart":18,"sourceCodeEnd":42,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/utility/project.ts#L18-L42","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nng g c header --project=myap\n// after\nng g c header --project=myapp","handlingStrategy":"validation","validationCode":"const ws = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nif (!(options.project in ws.projects)) {\n  throw new Error(`Unknown project '${options.project}'. Known: ${Object.keys(ws.projects).join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["angular","schematics","cli","workspace-config"],"backgroundTag":"project-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}