You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
#!/usr/bin/env node
|
|
|
|
function red(text) {
|
|
return '\u001b[31m' + text + '\u001b[39m';
|
|
}
|
|
function yellow(text) {
|
|
return '\u001b[33m' + text + '\u001b[39m';
|
|
}
|
|
|
|
const match = /v(\d+)\.(\d+)/.exec(process.version);
|
|
const major = parseInt(match[1], 10);
|
|
const minor = parseInt(match[2], 10);
|
|
|
|
const supportedVersions =
|
|
'expo-cli supports following Node.js versions:\n' +
|
|
'* >=12.13.0 <15.0.0 (Maintenance LTS)\n' +
|
|
'* >=16.0.0 <17.0.0 (Active LTS)\n';
|
|
|
|
// If newer than the current release
|
|
if (major > 16) {
|
|
// eslint-disable-next-line no-console
|
|
console.warn(
|
|
yellow(
|
|
'WARNING: expo-cli has not yet been tested against Node.js ' +
|
|
process.version +
|
|
'.\n' +
|
|
'If you encounter any issues, please report them to https://github.com/expo/expo-cli/issues\n' +
|
|
'\n' +
|
|
supportedVersions
|
|
)
|
|
);
|
|
} else if (!((major === 12 && minor >= 13) || major === 14 || major === 15 || major === 16)) {
|
|
// eslint-disable-next-line no-console
|
|
console.error(
|
|
red('ERROR: Node.js ' + process.version + ' is no longer supported.\n\n' + supportedVersions)
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
require('../build/exp.js').run('expo');
|