11// This function must be separate to avoid dependencies on C++ modules - it must execute precisely when other functions cannot
22
3+ import { color } from "../color" ;
34import { ISystemWarning } from "./declarations" ;
45
56// Use only ES5 code here - pure JavaScript can be executed with any Node.js version (even 0.10, 0.12).
@@ -11,7 +12,7 @@ var util = require("util");
1112// These versions cannot be used with CLI due to bugs in the node itself.
1213// We are absolutely sure we cannot work with them, so inform the user if he is trying to use any of them and exit the process.
1314var versionsCausingFailure = [ "0.10.34" , "4.0.0" , "4.2.0" , "5.0.0" ] ;
14- var minimumRequiredVersion = "22.12 .0" ;
15+ var minimumRequiredVersion = "8.0 .0" ;
1516
1617interface INodeVersionOpts {
1718 supportedVersionsRange : string ;
@@ -45,13 +46,15 @@ export function verifyNodeVersion(): void {
4546 semver . lt ( nodeVer , minimumRequiredVersion )
4647 ) {
4748 console . error (
48- util . format (
49- "%sNode.js '%s' is not supported. To be able to work with %s CLI, install any Node.js version in the following range: %s.%s" ,
50- os . EOL ,
51- nodeVer ,
52- cliName ,
53- supportedVersionsRange ,
54- os . EOL ,
49+ color . red . bold (
50+ util . format (
51+ "%sNode.js '%s' is not supported. To be able to work with %s CLI, install any Node.js version in the following range: %s.%s" ,
52+ os . EOL ,
53+ nodeVer ,
54+ cliName ,
55+ supportedVersionsRange ,
56+ os . EOL ,
57+ ) ,
5558 ) ,
5659 ) ;
5760 process . exit ( 1 ) ;
0 commit comments