From e0c513b24af927b2b8b63db68de3ae3b39a9d685 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Thu, 16 Feb 2023 03:24:55 +1100 Subject: [PATCH] Get node mver without regex. NFC (#18738) --- src/shell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell.js b/src/shell.js index 351193b636228..5ce1c61a10d7b 100644 --- a/src/shell.js +++ b/src/shell.js @@ -253,7 +253,7 @@ if (ENVIRONMENT_IS_NODE) { // not be needed with node v15 and about because it is now the default // behaviour: // See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode - var nodeMajor = process.version.match(/^v(\d+)\./)[1]; + var nodeMajor = process.versions.node.split(".")[0]; if (nodeMajor < 15) { process.on('unhandledRejection', function(reason) { throw reason; }); }