Update the packager's version check message for Node 4.0
Summary: Users should use Node 4.0 instead of io.js. This isn't a hard requirement since io.js still works but it's simpler if everyone is on the latest version. Closes https://github.com/facebook/react-native/pull/2547 Reviewed By: @svcscm Differential Revision: D2506388 Pulled By: @vjeux
This commit is contained in:
parent
bcf9c42bae
commit
ac069aaf12
|
@ -14,20 +14,20 @@ var semver = require('semver');
|
||||||
var formatBanner = require('./formatBanner');
|
var formatBanner = require('./formatBanner');
|
||||||
|
|
||||||
function checkNodeVersion() {
|
function checkNodeVersion() {
|
||||||
if (!semver.satisfies(process.version, '>=2.0.0')) {
|
if (!semver.satisfies(process.version, '>=4')) {
|
||||||
var engine = semver.lt(process.version, '1.0.0') ? 'Node' : 'io.js';
|
var engine = semver.satisfies(process.version, '<1 >=4') ? 'Node' : 'io.js';
|
||||||
var message = 'You are currently running ' + engine + ' ' +
|
var message = 'You are currently running ' + engine + ' ' +
|
||||||
process.version + '.\n' +
|
process.version + '.\n' +
|
||||||
'\n' +
|
'\n' +
|
||||||
'React Native is moving to io.js 2.x. There are several ways to upgrade' +
|
'React Native runs on Node 4.0 or newer. There are several ways to ' +
|
||||||
'to io.js depending on your preference.\n' +
|
'upgrade Node.js depending on your preference.\n' +
|
||||||
'\n' +
|
'\n' +
|
||||||
'nvm: nvm install iojs && nvm alias default iojs\n' +
|
'nvm: nvm install node && nvm alias default node\n' +
|
||||||
'Homebrew: brew unlink node; brew install iojs && brew ln iojs --force\n' +
|
'Homebrew: brew unlink iojs; brew install node\n' +
|
||||||
'Installer: download the Mac .pkg from https://iojs.org/\n' +
|
'Installer: download the Mac .pkg from https://nodejs.org/\n' +
|
||||||
'\n' +
|
'\n' +
|
||||||
'About io.js: https://iojs.org\n' +
|
'About Node.js: https://nodejs.org\n' +
|
||||||
'Follow along at: https://github.com/facebook/react-native/issues/1737';
|
'Follow along at: https://github.com/facebook/react-native/issues/2545';
|
||||||
console.log(formatBanner(message, {
|
console.log(formatBanner(message, {
|
||||||
chalkFunction: chalk.green,
|
chalkFunction: chalk.green,
|
||||||
marginLeft: 1,
|
marginLeft: 1,
|
||||||
|
|
Loading…
Reference in New Issue