#!/usr/bin/env node

/**
 * 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.
 */

console.error([
  '\033[31mLooks like you installed react-native globally, maybe you meant react-native-cli?',
  'To fix the issue, run:\033[0m',
  'npm uninstall -g react-native',
  'npm install -g react-native-cli'
].join('\n'));

process.exit(1);

@@ -324,16 +324,155 @@
 y.%0A */%0A%0A
+var script = process.argv%5B1%5D;%0Avar installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1;%0A%0Aif (installedGlobally) %7B%0A  
 console.
@@ -479,16 +479,18 @@
 error(%5B%0A
+  
   '%5C033%5B
@@ -578,16 +578,18 @@
 li?',%0A  
+ 
+ 
 'To fix 
@@ -613,16 +613,18 @@
 33%5B0m',%0A
+  
   'npm u
@@ -650,16 +650,18 @@
 ative',%0A
+  
   'npm i
@@ -688,16 +688,18 @@
 ve-cli'%0A
+  
 %5D.join('
@@ -705,17 +705,18 @@
 '%5Cn'));%0A
-%0A
+  
 process.
@@ -724,8 +724,45 @@
 xit(1);%0A
+%7D else %7B%0A  require('./cli').run();%0A%7D%0A

Fix usage of react-native cli inside package.json scripts