File tree Expand file tree Collapse file tree
packages/angular/cli/lib/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { logging } from '@angular-devkit/core';
1010import { format , stripVTControlCharacters } from 'node:util' ;
1111import { CommandModuleError } from '../../src/command-builder/command-module' ;
1212import { runCommand } from '../../src/command-builder/command-runner' ;
13+ import { PackageManagerError } from '../../src/package-managers' ;
1314import { colors , supportColor } from '../../src/utilities/color' ;
1415import { ngDebug } from '../../src/utilities/environment-options' ;
1516import { writeErrorToLogFile } from '../../src/utilities/log-file' ;
@@ -80,6 +81,10 @@ export default async function (options: { cliArgs: string[] }) {
8081 } catch ( err ) {
8182 if ( err instanceof CommandModuleError ) {
8283 logger . fatal ( `Error: ${ err . message } ` ) ;
84+ } else if ( err instanceof PackageManagerError ) {
85+ const errorMessage = `Error: Package installation failed ${ err . message } ` ;
86+ const output = err . stderr || err . stdout ;
87+ logger . fatal ( output ? `${ errorMessage } \n${ output } ` : errorMessage ) ;
8388 } else if ( err instanceof Error ) {
8489 try {
8590 const logPath = writeErrorToLogFile ( err ) ;
You can’t perform that action at this time.
0 commit comments