{"record":{"id":"ad9c566c5ffae738","repo":"angular/angular-cli","slug":"cannot-find-this-getarchitecttarget-target","errorCode":null,"errorMessage":"Cannot find \"${this.getArchitectTarget()}\" target for the specified project.\nYou can add a package that implements these capabilities.\n\nFor example:\n${choices.map(({ name, value }) => `  ${name}: ng add ${value}`).join('\n')}\n","messagePattern":"Cannot find \"(.+?)\" target for the specified project\\.\nYou can add a package that implements these capabilities\\.\n\nFor example:\n(.+?)\\) => `  (.+?): ng add (.+?)`\\)\\.join\\('\n'\\)\\}\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/command-builder/architect-base-command-module.ts","lineNumber":248,"sourceCode":"    const { logger } = this.context;\n    const choices = this.missingTargetChoices;\n\n    if (!choices?.length) {\n      logger.error(defaultMessage);\n\n      return 1;\n    }\n\n    const missingTargetMessage =\n      `Cannot find \"${this.getArchitectTarget()}\" target for the specified project.\\n` +\n      `You can add a package that implements these capabilities.\\n\\n` +\n      `For example:\\n` +\n      choices.map(({ name, value }) => `  ${name}: ng add ${value}`).join('\\n') +\n      '\\n';\n\n    if (isTTY()) {\n      // Use prompts to ask the user if they'd like to install a package.\n      logger.warn(missingTargetMessage);\n\n      const packageToInstall = await this.getMissingTargetPackageToInstall(choices);\n      if (packageToInstall) {\n        // Example run: `ng add angular-eslint`.\n        const AddCommandModule = (await import('../commands/add/cli')).default;\n        await new AddCommandModule(this.context).run({\n          interactive: true,\n          force: false,\n          dryRun: false,\n          defaults: false,\n          collection: packageToInstall,\n        });\n      }\n    } else {\n      // Non TTY display error message.\n      logger.error(missingTargetMessage);\n    }\n","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/command-builder/architect-base-command-module.ts#L230-L266","documentation":"ArchitectBaseCommandModule.onMissingTarget warns when a builder target (e.g. build/test/serve) cannot be found for the project in angular.json and no installed package provides that builder capability. Because the target is missing, the command cannot run; the CLI lists candidate `ng add <package>` choices, and in a TTY interactively offers to install one.","triggerScenarios":"Running a command like `ng build`/`ng test`/`ng lint` against a project whose angular.json has no matching architect target and no node_modules package implementing the required builder (e.g. @angular-eslint/builder for lint).","commonSituations":"Fresh project missing an optional target (no lint/e2e configured); a builder package was uninstalled or pruned from node_modules; angular.json target removed or project misnamed on the command line; using an Angular version whose builder moved into a separate package.","solutions":["Install the package that implements the capability shown in the message, e.g. `ng add angular-eslint` for lint targets.","Verify angular.json contains an architect target with the expected builder name for the project you are targeting.","Run `npm install` to restore missing node_modules packages that provide builders.","Check you spelled the project name correctly (`--project` flag) and the target name in angular.json."],"exampleFix":"// before: package.json has no lint builder\nng lint\n// Error: Cannot find \"lint\" target...\n// after\nng add angular-eslint\nng lint // works","handlingStrategy":"validation","validationCode":"const cfg = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nconst project = cfg.projects[projectName];\nif (!project?.architect?.[targetName]) {\n  console.error(`Target '${targetName}' missing for '${projectName}'. Run: ng add <package providing the builder>`);\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use `ng add` for lint/e2e tooling so builders and angular.json targets are installed together.","Commit angular.json target configuration and keep node_modules installed via lockfile.","Validate --project names in CI scripts against angular.json."],"tags":["angular-cli","architect","missing-target","builder"],"backgroundTag":"missing-architect-target","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}