Skip to content

Commit

Permalink
fix(@angular/cli): show error when using x18n command on Node.js 12.0
Browse files Browse the repository at this point in the history
Node.js 12.0 contains a defect which will cause the command to crash.  This is due to the locale support in Node.js 12.0 (ICU).  ref: nodejs/node#27379
  • Loading branch information
clydin authored and mgechev committed May 22, 2019
1 parent 2ccf8ec commit 6037692
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/angular/cli/commands/xi18n-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ export class Xi18nCommand extends ArchitectCommand<Xi18nCommandSchema> {
public readonly multiTarget: true;

public async run(options: Xi18nCommandSchema & Arguments) {
const version = process.version.substr(1).split('.');
if (Number(version[0]) === 12 && Number(version[1]) === 0) {
this.logger.error(
'Due to a defect in Node.js 12.0, the command is not supported on this Node.js version. '
+ 'Please upgrade to Node.js 12.1 or later.');

return 1;
}

return this.runArchitectTarget(options);
}
}

0 comments on commit 6037692

Please sign in to comment.