{"record":{"id":"cef7bd1fdb217aec","repo":"angular/angular-cli","slug":"project-project-does-not-exist","errorCode":null,"errorMessage":"Project \"${project}\" does not exist.","messagePattern":"Project \"(.+?)\" does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/architect/node/node-modules-architect-host.ts","lineNumber":50,"sourceCode":"  }\n}\n\nexport interface WorkspaceHost {\n  getBuilderName(project: string, target: string): Promise<string>;\n  getMetadata(project: string): Promise<json.JsonObject>;\n  getOptions(project: string, target: string, configuration?: string): Promise<json.JsonObject>;\n  hasTarget(project: string, target: string): Promise<boolean>;\n  getDefaultConfigurationName(project: string, target: string): Promise<string | undefined>;\n}\n\nfunction findProjectTarget(\n  workspace: workspaces.WorkspaceDefinition,\n  project: string,\n  target: string,\n): workspaces.TargetDefinition {\n  const projectDefinition = workspace.projects.get(project);\n  if (!projectDefinition) {\n    throw new Error(`Project \"${project}\" does not exist.`);\n  }\n\n  const targetDefinition = projectDefinition.targets.get(target);\n  if (!targetDefinition) {\n    throw new Error('Project target does not exist.');\n  }\n\n  if (!targetDefinition.builder) {\n    throw new Error(`A builder is not set for target '${target}' in project '${project}'.`);\n  }\n\n  return targetDefinition;\n}\n\nexport class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModulesBuilderInfo> {\n  private workspaceHost: WorkspaceHost;\n\n  constructor(workspaceHost: WorkspaceHost, _root: string);","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/architect/node/node-modules-architect-host.ts#L32-L68","documentation":"The `WorkspaceNodeModulesArchitectHost` resolves builder targets from the workspace definition. `findProjectTarget` calls `workspace.projects.get(project)` and throws when no project with that name exists in `angular.json` (or the programmatic workspace), typically because the project name was misspelled or omitted from the workspace config.","triggerScenarios":"Running a builder/architect target programmatically or via CLI (`nx`/`ng run project:target`) where `project` does not match any entry in `workspace.projects` — e.g. `ng run myap:build` instead of `myapp:build`, or a project removed/renamed in angular.json.","commonSituations":"Typos in the `--project` flag; custom tooling/scripts calling the architect host with hardcoded names; projects renamed after scaffolding; multi-config (extra-webpack or NX) setups where the project lives in a different workspace file.","solutions":["Correct the project name in the command or script to exactly match a project in angular.json.","Run `ng list` / inspect angular.json's `projects` key to see valid names.","Restore/rename the project definition in angular.json if it was accidentally removed.","In custom code, check `workspace.projects.has(project)` before calling the architect host."],"exampleFix":"// before\nng run myap:build\n// after\nng run myapp:build","handlingStrategy":"validation","validationCode":"import { workspaces } from '@angular-devkit/core';\nconst reg = await host.getWorkspaceName?.(); // or read angular.json directly\nconst { projects } = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nif (!projects[project]) throw new Error(`Project \"${project}\" not in angular.json; valid: ${Object.keys(projects).join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await architectHost.findProjectTarget(workspace, project, target);\n} catch (e) {\n  if ((e as Error).message.startsWith('Project \"') && (e as Error).message.includes('does not exist')) {\n    console.error(`Unknown project \"${project}\". Check angular.json projects key.`);\n    process.exitCode = 1;\n  } else { throw e; }\n}","preventionTips":["Never hardcode project names; read them from angular.json or CLI flags.","Run `ng list` to confirm project names before scripting `ng run`.","Grep CI scripts after renaming or removing projects."],"tags":["angular-cli","architect","workspace","configuration"],"backgroundTag":"project-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}