ScuttleBot
| f7eb47b… | lmata | 1 | /** |
| f7eb47b… | lmata | 2 | * Copyright (c) Microsoft Corporation. |
| f7eb47b… | lmata | 3 | * |
| f7eb47b… | lmata | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| f7eb47b… | lmata | 5 | * you may not use this file except in compliance with the License. |
| f7eb47b… | lmata | 6 | * You may obtain a copy of the License at |
| f7eb47b… | lmata | 7 | * |
| f7eb47b… | lmata | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| f7eb47b… | lmata | 9 | * |
| f7eb47b… | lmata | 10 | * Unless required by applicable law or agreed to in writing, software |
| f7eb47b… | lmata | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| f7eb47b… | lmata | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| f7eb47b… | lmata | 13 | * See the License for the specific language governing permissions and |
| f7eb47b… | lmata | 14 | * limitations under the License. |
| f7eb47b… | lmata | 15 | */ |
| f7eb47b… | lmata | 16 | const minimumMajorNodeVersion = 18; |
| f7eb47b… | lmata | 17 | const currentNodeVersion = process.versions.node; |
| f7eb47b… | lmata | 18 | const semver = currentNodeVersion.split('.'); |
| f7eb47b… | lmata | 19 | const [major] = [+semver[0]]; |
| f7eb47b… | lmata | 20 | |
| f7eb47b… | lmata | 21 | if (major < minimumMajorNodeVersion) { |
| f7eb47b… | lmata | 22 | console.error( |
| f7eb47b… | lmata | 23 | 'You are running Node.js ' + |
| f7eb47b… | lmata | 24 | currentNodeVersion + |
| f7eb47b… | lmata | 25 | '.\n' + |
| f7eb47b… | lmata | 26 | `Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` + |
| f7eb47b… | lmata | 27 | 'Please update your version of Node.js.' |
| f7eb47b… | lmata | 28 | ); |
| f7eb47b… | lmata | 29 | process.exit(1); |
| f7eb47b… | lmata | 30 | } |
| f7eb47b… | lmata | 31 | |
| f7eb47b… | lmata | 32 | module.exports = require('./lib/inprocess'); |