{"record":{"id":"e7d89de838aec601","repo":"angular/angular-cli","slug":"command-aborted","errorCode":null,"errorMessage":"Command aborted","messagePattern":"Command aborted","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"info","filePath":"packages/angular/cli/src/commands/add/cli.ts","lineNumber":592,"sourceCode":"    if (!isTTY()) {\n      task.output =\n        `'--skip-confirmation' can be used to bypass installation confirmation. ` +\n        `Ensure package name is correct prior to '--skip-confirmation' option usage.`;\n      throw new CommandError('No terminal detected');\n    }\n\n    const { ListrInquirerPromptAdapter } = await import('@listr2/prompt-adapter-inquirer');\n    const { confirm } = await import('@inquirer/prompts');\n    const shouldProceed = await task.prompt(ListrInquirerPromptAdapter).run(confirm, {\n      message:\n        `The package ${color.blue(context.packageIdentifier.toString())} will be installed and executed.\\n` +\n        'Would you like to proceed?',\n      default: true,\n      theme: { prefix: '' },\n    });\n\n    if (!shouldProceed) {\n      throw new CommandError('Command aborted');\n    }\n  }\n\n  private async cleanUpTemporaryDependency(packageName: string): Promise<void> {\n    try {\n      this.context.logger.info(`Cleaning up temporary dependency '${packageName}'...`);\n\n      // 1. Remove from root package.json\n      const projectManifest = await this.getProjectManifest();\n      if (projectManifest) {\n        if (projectManifest.dependencies) {\n          delete projectManifest.dependencies[packageName];\n        }\n        if (projectManifest.devDependencies) {\n          delete projectManifest.devDependencies[packageName];\n        }\n\n        await fs.writeFile(","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/add/cli.ts#L574-L610","documentation":"After showing the interactive confirmation prompt, if the user answers 'No' (shouldProceed is falsy), confirmInstallationTask throws 'Command aborted'. This is an intentional, user-initiated cancellation of the `ng add` installation — not an internal failure.","triggerScenarios":"The user selects the default-rejecting/no answer at the 'Would you like to proceed?' confirm prompt, or aborts the prompt with Ctrl+C / Esc, causing the prompt to resolve falsy.","commonSituations":"Developer inspects the package to be installed and declines; accidental Enter on a misconfigured prompt theme; killing the prompt mid-way in a terminal.","solutions":["Re-run `ng add <package>` and answer 'Yes' (or just press Enter, since default is true) to proceed.","If you never want the prompt, use `--skip-confirmation` to install without asking.","Nothing is broken — verify the intended package name/version and retry.","If prompts crash instead of aborting cleanly, check terminal TTY support and listr2/inquirer compatibility."],"exampleFix":"// before\nWould you like to proceed? (Y/n) n   # Command aborted\n// after\nWould you like to proceed? (Y/n) Y","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await runNgAdd(pkg);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Command aborted') {\n    console.log('Installation cancelled by user; nothing was installed.');\n    return; // treat as normal cancellation, not failure\n  }\n  throw e;\n}","preventionTips":["Treat 'Command aborted' as a benign cancellation in scripts and retry only intentionally.","Communicate to users what the prompt will install so they do not decline accidentally.","Use --skip-confirmation in automation to avoid the prompt entirely.","Keep default answer (true) in mind: pressing Enter accepts installation."],"tags":["user-cancellation","interactive","prompt","angular-cli"],"backgroundTag":"command-aborted-by-user","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}