chore: refactored minimum Node Major version to variable (#24188)
This commit is contained in:
parent
bca32f389b
commit
0eb94aaa79
|
|
@ -13,18 +13,18 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
const minimumMajorNodeVersion = 14;
|
||||||
const currentNodeVersion = process.versions.node;
|
const currentNodeVersion = process.versions.node;
|
||||||
const semver = currentNodeVersion.split('.');
|
const semver = currentNodeVersion.split('.');
|
||||||
const [major] = [+semver[0]];
|
const [major] = [+semver[0]];
|
||||||
|
|
||||||
if (major < 14) {
|
if (major < minimumMajorNodeVersion) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(
|
console.error(
|
||||||
'You are running Node.js ' +
|
'You are running Node.js ' +
|
||||||
currentNodeVersion +
|
currentNodeVersion +
|
||||||
'.\n' +
|
'.\n' +
|
||||||
'Playwright requires Node.js 14 or higher. \n' +
|
`Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` +
|
||||||
'Please update your version of Node.js.'
|
'Please update your version of Node.js.'
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue