{"record":{"id":"b74796fed82e3282","repo":"angular/angular-cli","slug":"project-target-does-not-exist","errorCode":null,"errorMessage":"Project target does not exist.","messagePattern":"Project target does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/architect/node/node-modules-architect-host.ts","lineNumber":55,"sourceCode":"  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);\n\n  constructor(workspace: workspaces.WorkspaceDefinition, _root: string);\n\n  constructor(\n    workspaceOrHost: workspaces.WorkspaceDefinition | WorkspaceHost,","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/architect/node/node-modules-architect-host.ts#L37-L73","documentation":"After finding the project, `findProjectTarget` looks up the target (`projectDefinition.targets.get(target)`) and throws this generic error when the named target does not exist on that project. The message intentionally does not echo names; it means the `project:target` pair's second part is wrong.","triggerScenarios":"Executing `ng run project:serv` (instead of `serve`), or programmatically invoking the architect host with a target name not defined in the project's architect/targets section of angular.json.","commonSituations":"Typos in target names; missing `configurations`/target because the builder section was deleted; using an enterprise builder name that was never added to the project; schema differences between angular.json versions.","solutions":["Verify the target exists in angular.json under projects.<name>.architect (or targets).","Fix typos in the target portion of the `project:target[:configuration]` string.","Add the missing target definition (or run the correct builder name, e.g. `build`, `serve`, `test`).","In custom scripts, check `projectDefinition.targets.has(target)` first for a clearer message."],"exampleFix":"// before\nng run myapp:servee\n// after\nng run myapp:serve","handlingStrategy":"validation","validationCode":"const cfg = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nconst targets = cfg.projects?.[project]?.architect ?? cfg.projects?.[project]?.targets ?? {};\nif (!(target in targets)) throw new Error(`Target \"${target}\" missing for project \"${project}\"; available: ${Object.keys(targets).join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await runTarget({ project, target });\n} catch (e) {\n  if ((e as Error).message === 'Project target does not exist.') {\n    console.error(`Target \"${target}\" is not defined for \"${project}\".`);\n  } else { throw e; }\n}","preventionTips":["Tab-complete target names with the Angular CLI instead of typing them.","Keep the standard build/serve/test targets present in every project.","Add a startup check that validates required project:target pairs in CI."],"tags":["angular-cli","architect","workspace","configuration"],"backgroundTag":"target-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}