2015-04-08 04:11:46 +00:00
|
|
|
#!/usr/bin/env node
|
2015-10-26 18:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
2016-04-26 22:40:23 +00:00
|
|
|
var script = process.argv[1];
|
|
|
|
var installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1;
|
2016-01-05 23:21:25 +00:00
|
|
|
|
2016-04-26 22:40:23 +00:00
|
|
|
if (installedGlobally) {
|
2017-07-12 20:48:49 +00:00
|
|
|
const chalk = require('chalk');
|
|
|
|
|
2016-04-26 22:40:23 +00:00
|
|
|
console.error([
|
2017-07-12 20:48:49 +00:00
|
|
|
chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'),
|
|
|
|
chalk.red('To fix the issue, run:'),
|
2016-04-26 22:40:23 +00:00
|
|
|
'npm uninstall -g react-native',
|
|
|
|
'npm install -g react-native-cli'
|
|
|
|
].join('\n'));
|
|
|
|
process.exit(1);
|
|
|
|
} else {
|
|
|
|
require('./cli').run();
|
|
|
|
}
|