@@ -8,31 +8,38 @@ import * as semver from 'semver';
88
99const nodeVersion : string = process . versions . node ;
1010
11- // tslint:disable-next-line
11+ interface IExtendedNodeProcess extends NodeJS . Process {
12+ release : {
13+ lts ?: string ;
14+ } ;
15+ }
1216
1317// We are on an ancient version of NodeJS that is known not to work with Rush
14- if ( semver . satisfies ( nodeVersion , '<= 6.4.0' ) ) {
15- console . error ( colors . red ( `Your version of Node.js (${ nodeVersion } ) is very old and incompatible with Rush.`
16- + ` Please upgrade to the latest Long-Term Support (LTS) version.` ) ) ;
18+ if ( semver . satisfies ( nodeVersion , '< 8.9.0' ) ) {
19+ console . error ( colors . red (
20+ `Your version of Node.js (${ nodeVersion } ) is very old and incompatible with Rush. ` +
21+ `Please upgrade to the latest Long-Term Support (LTS) version.`
22+ ) ) ;
1723 process . exit ( 1 ) ;
1824}
1925
2026// We are on a much newer release than we have tested and support
2127// tslint:disable-next-line
22- else if ( semver . satisfies ( nodeVersion , '>=11.0.0' ) ) {
23- console . warn ( colors . yellow ( `Your version of Node.js (${ nodeVersion } ) has not been tested with this release of Rush.`
24- + ` The Rush team will not accept issue reports for it.`
25- + ` Please consider upgrading Rush or downgrading Node.js.` ) ) ;
28+ else if ( semver . satisfies ( nodeVersion , '>= 11.0.0' ) ) {
29+ console . warn ( colors . yellow (
30+ `Your version of Node.js (${ nodeVersion } ) has not been tested with this release ` +
31+ `of Rush. Please consider installing a newer version of the "@microsoft/rush" ` +
32+ `package, or else downgrading Node.js.`
33+ ) ) ;
2634}
2735
2836// We are not on an LTS release
2937// tslint:disable-next-line
30- else if ( ! semver . satisfies ( nodeVersion , '^6.9.0' )
31- && ! semver . satisfies ( nodeVersion , '^8.9.0' )
32- && ! semver . satisfies ( nodeVersion , '^10.13.0' ) ) {
33- console . warn ( colors . yellow ( `Your version of Node.js (${ nodeVersion } ) is not a Long-Term Support (LTS) release.`
34- + ` These versions frequently contain bugs, and the Rush team will not accept issue reports for them.`
35- + ` Please consider installing a stable release.` ) ) ;
38+ else if ( ( process as IExtendedNodeProcess ) . release . lts ) {
39+ console . warn ( colors . yellow (
40+ `Your version of Node.js (${ nodeVersion } ) is not a Long-Term Support (LTS) release. ` +
41+ `These versions frequently have bugs. Please consider installing a stable release.`
42+ ) ) ;
3643}
3744
3845import {
0 commit comments