Skip to content

Commit 7394bac

Browse files
feat: update supported Node.js versions
Update supported Node.js versions according to https://github.com/nodejs/Release - Stop support for Node.js 6 and 7 - CLI will not allow execution of any command when this Node.js is used. - Deprecate support for Node.js 8 and 9 - CLI will print warning on each command when any of those versions is used - Add official support for Node.js 12 - CLI will not print warning for this version as it is officially supported now. Also fix the check of `getNodeWarning` method which was returning warning only the first time when it is called.
1 parent 6343541 commit 7394bac

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

lib/common/verify-node-version.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var util = require("util");
1010
// These versions cannot be used with CLI due to bugs in the node itself.
1111
// 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.
1212
var versionsCausingFailure = ["0.10.34", "4.0.0", "4.2.0", "5.0.0"];
13-
var minimumRequiredVersion = "6.0.0";
13+
var minimumRequiredVersion = "8.0.0";
1414

1515
interface INodeVersionOpts {
1616
supportedVersionsRange: string;
@@ -22,7 +22,7 @@ interface INodeVersionOpts {
2222
function getNodeVersionOpts(): INodeVersionOpts {
2323
var supportedVersionsRange = require("../../package.json").engines.node;
2424
var cliName = "NativeScript";
25-
var deprecatedVersions = ["^6.0.0", "^7.0.0"];
25+
var deprecatedVersions = ["^8.0.0", "^9.0.0"];
2626
var nodeVer = process.version.substr(1);
2727
return {
2828
supportedVersionsRange: supportedVersionsRange,
@@ -53,11 +53,10 @@ export function verifyNodeVersion(): void {
5353
}
5454
}
5555

56-
var isGetNodeWarningCalled = false;
56+
var nodeWarn: ISystemWarning = undefined;
5757
export function getNodeWarning(): ISystemWarning {
58-
if (!isGetNodeWarningCalled) {
59-
isGetNodeWarningCalled = true;
60-
58+
if (nodeWarn === undefined) {
59+
nodeWarn = null;
6160
var verificationOpts = getNodeVersionOpts();
6261
var cliName = verificationOpts.cliName;
6362
var supportedVersionsRange = verificationOpts.supportedVersionsRange;
@@ -83,13 +82,13 @@ export function getNodeWarning(): ISystemWarning {
8382
}
8483

8584
if (warningMessage) {
86-
return {
85+
nodeWarn = {
8786
message: warningMessage,
8887
severity: SystemWarningsSeverity.medium
8988
};
9089
}
91-
92-
return null;
9390
}
91+
92+
return nodeWarn;
9493
}
9594
/* tslint:enable */

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@
131131
},
132132
"license": "Apache-2.0",
133133
"engines": {
134-
"node": ">=8.0.0 <12.0.0"
134+
"node": ">=10.0.0 <13.0.0"
135135
}
136136
}

0 commit comments

Comments
 (0)