added warning for incompatible versions of node

This commit is contained in:
Dan Motzenbecker 2015-10-03 15:36:24 -04:00
parent 142128c938
commit 1e760335f4
1 changed files with 9 additions and 1 deletions

View File

@ -11,8 +11,10 @@ cli = require 'commander'
chalk = require 'chalk'
semver = require 'semver'
reactInit = require 'react-native/local-cli/init'
rnVersion = require(__dirname + '/package.json').dependencies['react-native']
pkgJson = require __dirname + '/package.json'
nodeVersion = pkgJson.engines.node
rnVersion = pkgJson.dependencies['react-native']
resources = __dirname + '/resources/'
camelRx = /([a-z])([A-Z])/g
projNameRx = /\$PROJECT_NAME\$/g
@ -255,4 +257,10 @@ cli.command 'listdevices'
.join '\n')
unless semver.satisfies process.version[1...], nodeVersion
logErr """
Natal requires Node.js version #{nodeVersion}
You have #{process.version[1...]}
"""
cli.parse process.argv