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 committed May 20, 2019
1 parent c81adbd commit 9fa4373
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/angular/cli/commands/xi18n-impl.ts
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 9fa4373

Please sign in to comment.