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-05-12 00:24:00 +00:00
|
|
|
if (!semver.satisfies(process.version, '>=8')) {
|
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-05-12 00:24:00 +00:00
|
|
|
'React Native runs on Node 8.0 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' +
|
2015-10-03 18:45:08 +00:00
|
|
|
'nvm: nvm install node && nvm alias default node\n' +
|
|
|
|
'Homebrew: brew unlink iojs; brew install node\n' +
|
|
|
|
'Installer: download the Mac .pkg from https://nodejs.org/\n' +
|
2015-07-10 07:23:58 +00:00
|
|
|
'\n' +
|
2015-10-03 18:45:08 +00:00
|
|
|
'About Node.js: https://nodejs.org\n' +
|
2018-05-12 00:24:00 +00:00
|
|
|
'Follow along at: https://github.com/facebook/react-native/issues/19226';
|
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
|
|
|
};
|