Skip to content

feat: update supported Node.js versions #4675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions lib/common/verify-node-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var util = require("util");
// These versions cannot be used with CLI due to bugs in the node itself.
// 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.
var versionsCausingFailure = ["0.10.34", "4.0.0", "4.2.0", "5.0.0"];
var minimumRequiredVersion = "6.0.0";
var minimumRequiredVersion = "8.0.0";

interface INodeVersionOpts {
supportedVersionsRange: string;
Expand All @@ -22,7 +22,7 @@ interface INodeVersionOpts {
function getNodeVersionOpts(): INodeVersionOpts {
var supportedVersionsRange = require("../../package.json").engines.node;
var cliName = "NativeScript";
var deprecatedVersions = ["^6.0.0", "^7.0.0"];
var deprecatedVersions = ["^8.0.0", "^9.0.0"];
var nodeVer = process.version.substr(1);
return {
supportedVersionsRange: supportedVersionsRange,
Expand Down Expand Up @@ -53,11 +53,10 @@ export function verifyNodeVersion(): void {
}
}

var isGetNodeWarningCalled = false;
var nodeWarn: ISystemWarning = undefined;
export function getNodeWarning(): ISystemWarning {
if (!isGetNodeWarningCalled) {
isGetNodeWarningCalled = true;

if (nodeWarn === undefined) {
nodeWarn = null;
var verificationOpts = getNodeVersionOpts();
var cliName = verificationOpts.cliName;
var supportedVersionsRange = verificationOpts.supportedVersionsRange;
Expand All @@ -83,13 +82,13 @@ export function getNodeWarning(): ISystemWarning {
}

if (warningMessage) {
return {
nodeWarn = {
message: warningMessage,
severity: SystemWarningsSeverity.medium
};
}

return null;
}

return nodeWarn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can return a deep copy, so that consumers can't modify the warning. Not a merge blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, so I'll keep it this way for the moment and I'll keep it in mind in case such issue occurs in the future. Thanks for the suggestion.

}
/* tslint:enable */
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0 <12.0.0"
"node": ">=10.0.0 <13.0.0"
}
}