Skip to content

Commit 12496ab

Browse files
committed
Update version warning messages.
1 parent 4ad56c9 commit 12496ab

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

apps/rush/src/start.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,38 @@ import * as semver from 'semver';
88

99
const 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

3845
import {

0 commit comments

Comments
 (0)