diff --git a/packages/@angular/cli/utilities/stats.ts b/packages/@angular/cli/utilities/stats.ts index 87bb31a540c6..2275227a7d6d 100644 --- a/packages/@angular/cli/utilities/stats.ts +++ b/packages/@angular/cli/utilities/stats.ts @@ -1,7 +1,12 @@ -import { bold, green, red, reset, white, yellow } from 'chalk'; +import * as chalk from 'chalk'; import { stripIndents } from 'common-tags'; +// Force basic color support on terminals with no color support. +// Chalk typings don't have the correct constructor parameters. +const chalkCtx = new (chalk.constructor as any)(chalk.supportsColor ? {} : { level: 1 }); +const { bold, green, red, reset, white, yellow } = chalkCtx; + function _formatSize(size: number): string { if (size <= 0) { return '0 bytes';