2015-07-10 07:23:58 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-05-11 19:43:49 +00:00
|
|
|
*
|
|
|
|
* @format
|
2015-07-10 07:23:58 +00:00
|
|
|
*/
|
2018-05-11 19:43:49 +00:00
|
|
|
|
2015-07-10 07:23:58 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-05-21 13:53:32 +00:00
|
|
|
var chalk = require('chalk');
|
2017-12-15 14:21:11 +00:00
|
|
|
var formatBanner = require('metro-core/src/formatBanner');
|
2016-05-21 13:53:32 +00:00
|
|
|
var semver = require('semver');
|
2015-07-10 07:23:58 +00:00
|
|
|
|
2015-10-12 23:46:52 +00:00
|
|
|
module.exports = function() {
|
2018-07-18 03:59:53 +00:00
|
|
|
if (!semver.satisfies(process.version, '>=8.3')) {
|
2018-05-11 19:43:49 +00:00
|
|
|
var engine = semver.satisfies(process.version, '<1') ? 'Node' : 'io.js';
|
2015-10-12 23:46:52 +00:00
|
|
|
|
2018-05-11 19:43:49 +00:00
|
|
|
var message =
|
|
|
|
'You are currently running ' +
|
|
|
|
engine +
|
|
|
|
' ' +
|
|
|
|
process.version +
|
|
|
|
'.\n' +
|
2015-07-10 07:23:58 +00:00
|
|
|
'\n' +
|
2018-07-18 03:59:53 +00:00
|
|
|
'React Native runs on Node 8.3 or newer. There are several ways to ' +
|
2015-10-03 18:45:08 +00:00
|
|
|
'upgrade Node.js depending on your preference.\n' +
|
2015-07-10 07:23:58 +00:00
|
|
|
'\n' +
|
2018-07-18 03:59:53 +00:00
|
|
|
'nvm: nvm install 8.3 --reinstall-packages-from=node\n' +
|
|
|
|
'Homebrew: brew update && brew upgrade node\n' +
|
|
|
|
'Installer: download from https://nodejs.org/\n';
|
2018-05-11 19:43:49 +00:00
|
|
|
console.log(
|
|
|
|
formatBanner(message, {
|
|
|
|
chalkFunction: chalk.green,
|
|
|
|
marginLeft: 1,
|
|
|
|
marginRight: 1,
|
|
|
|
paddingBottom: 1,
|
|
|
|
}),
|
|
|
|
);
|
2016-02-04 23:22:12 +00:00
|
|
|
process.exit(1);
|
2015-07-10 07:23:58 +00:00
|
|
|
}
|
2015-10-12 23:46:52 +00:00
|
|
|
};
|