mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-06 03:16:17 +03:00
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
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const minimumMajorNodeVersion = 14;
|
||||
const currentNodeVersion = process.versions.node;
|
||||
const semver = currentNodeVersion.split('.');
|
||||
const [major] = [+semver[0]];
|
||||
|
||||
if (major < 14) {
|
||||
if (major < minimumMajorNodeVersion) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
'You are running Node.js ' +
|
||||
currentNodeVersion +
|
||||
'.\n' +
|
||||
'Playwright requires Node.js 14 or higher. \n' +
|
||||
`Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` +
|
||||
'Please update your version of Node.js.'
|
||||
);
|
||||
process.exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user