Skip to content

Commit 20b5d91

Browse files
committed
feat(@angular/cli): use STDERR to report warnings
1 parent b4a3076 commit 20b5d91

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/angular/cli/lib/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ try {
9999
// Don't show warning colorised on `ng completion`
100100
if (process.argv[2] !== 'completion') {
101101
// eslint-disable-next-line no-console
102-
console.log(warning);
102+
console.error(warning);
103103
} else {
104104
// eslint-disable-next-line no-console
105105
console.error(warning);
@@ -141,6 +141,6 @@ cli({
141141
process.exit(exitCode);
142142
})
143143
.catch((err: Error) => {
144-
console.log('Unknown error: ' + err.toString());
144+
console.error('Unknown error: ' + err.toString());
145145
process.exit(127);
146146
});

packages/angular/cli/upgrade/version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Version {
8787
const rxjsVersion = new Version(rxjsPkgJson['version']);
8888

8989
if (angularVersion.isLocal()) {
90-
console.warn(terminal.yellow('Using a local version of angular. Proceeding with care...'));
90+
console.error(terminal.yellow('Using a local version of angular. Proceeding with care...'));
9191

9292
return;
9393
}
@@ -175,7 +175,7 @@ export class Version {
175175

176176
if (currentCombo && !satisfies(tsVersion, currentCombo.typescript)) {
177177
// First line of warning looks weird being split in two, disable tslint for it.
178-
console.log((terminal.yellow('\n' + tags.stripIndent`
178+
console.error((terminal.yellow('\n' + tags.stripIndent`
179179
@angular/compiler-cli@${compilerVersion} requires typescript@'${
180180
currentCombo.typescript}' but ${tsVersion} was found instead.
181181
Using this version can result in undefined behaviour and difficult to debug problems.

packages/angular/cli/utilities/check-package-manager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ export function checkYarnOrCNPM() {
2727
.then((data: Array<boolean>) => {
2828
const [isYarnInstalled, isCNPMInstalled] = data;
2929
if (isYarnInstalled && isCNPMInstalled) {
30-
console.log(terminal.yellow('You can `ng config -g cli.packageManager yarn` '
30+
console.error(terminal.yellow('You can `ng config -g cli.packageManager yarn` '
3131
+ 'or `ng config -g cli.packageManager cnpm`.'));
3232
} else if (isYarnInstalled) {
33-
console.log(terminal.yellow('You can `ng config -g cli.packageManager yarn`.'));
33+
console.error(terminal.yellow('You can `ng config -g cli.packageManager yarn`.'));
3434
} else if (isCNPMInstalled) {
35-
console.log(terminal.yellow('You can `ng config -g cli.packageManager cnpm`.'));
35+
console.error(terminal.yellow('You can `ng config -g cli.packageManager cnpm`.'));
3636
} else {
3737
if (packageManager !== 'default' && packageManager !== 'npm') {
38-
console.log(terminal.yellow(`Seems that ${packageManager} is not installed.`));
39-
console.log(terminal.yellow('You can `ng config -g cli.packageManager npm`.'));
38+
console.error(terminal.yellow(`Seems that ${packageManager} is not installed.`));
39+
console.error(terminal.yellow('You can `ng config -g cli.packageManager npm`.'));
4040
}
4141
}
4242
});

0 commit comments

Comments
 (0)