File tree Expand file tree Collapse file tree
packages/angular/cli/src/commands/update Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,12 @@ import {
2020 Options ,
2121} from '../../command-builder/command-module' ;
2222import { SchematicEngineHost } from '../../command-builder/utilities/schematic-engine-host' ;
23- import type { InstalledPackage , PackageManager , PackageManifest } from '../../package-managers' ;
23+ import {
24+ type InstalledPackage ,
25+ type PackageManager ,
26+ PackageManagerError ,
27+ type PackageManifest ,
28+ } from '../../package-managers' ;
2429import { colors } from '../../utilities/color' ;
2530import { disableVersionCheck } from '../../utilities/environment-options' ;
2631import { assertIsError } from '../../utilities/error' ;
@@ -596,7 +601,16 @@ export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs
596601 ignorePeerDependencies,
597602 } ) ;
598603 } catch ( e ) {
599- throw new CommandError ( 'Unable to install packages' ) ;
604+ let message = 'Unable to install packages' ;
605+ if ( e instanceof PackageManagerError ) {
606+ const stdout = e . stdout . trim ( ) ;
607+ const stderr = e . stderr . trim ( ) ;
608+ message += `: ${ colors . bold ( e . message ) } ${
609+ stdout ? `\n\n${ colors . bold ( '[STDOUT]' ) } : ${ stdout } ` : ''
610+ } ${ stderr ? `\n\n${ colors . bold ( '[STDERR]' ) } : ${ colors . red ( stderr ) } ` : '' } `;
611+ }
612+
613+ throw new CommandError ( message ) ;
600614 }
601615 } ,
602616 } ,
You can’t perform that action at this time.
0 commit comments