Skip to content

Commit 4f54443

Browse files
fix: warnings for Node.js version should be shown once
Currently when you are using a deprecated Node.js version, CLI prints warnings twice. The problem is that there are two places in the code where we check Node.js version: - In `tns` executable file - the code in it is pure ES5 and the idea is to stop users which have very old Node.js versions, whcih do not support ES6 syntax (CLI is transpiled to ES6 syntax). - In `nativescript-cli` file - we call `initializeService.initialize`, which also checks Node.js version and prints the warnings However, we do not need the warnings in both places. Separate the logic, so in `tns` file we'll just check if we should stop the users, i.e. it will take care only of versions which are not supported. In `nativescript-cli` we'll continue calling initialize, which will take care of the warnings (in case there are such). This way the warning for not supported version will be printed only once.
1 parent 6d274fe commit 4f54443

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/common/verify-node-version.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ export function verifyNodeVersion(): void {
4646
os.EOL, nodeVer, cliName, supportedVersionsRange, os.EOL).red.bold);
4747
process.exit(1);
4848
}
49-
50-
var nodeWarning = getNodeWarning();
51-
if (nodeWarning && nodeWarning.message) {
52-
console.warn((os.EOL + nodeWarning.message + os.EOL).yellow.bold);
53-
}
5449
}
5550

5651
var nodeWarn: ISystemWarning = undefined;

0 commit comments

Comments
 (0)