From 0a5967dbfe8629074297f8ec5d85dd5d70a91a79 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 7 Apr 2015 21:11:46 -0700 Subject: [PATCH] Warn when installing globally react-native instead of react-native-cli This adds a react-native binary that just output some instructions. --- local-cli/wrong-react-native.js | 7 +++++++ package.json | 1 + 2 files changed, 8 insertions(+) create mode 100755 local-cli/wrong-react-native.js diff --git a/local-cli/wrong-react-native.js b/local-cli/wrong-react-native.js new file mode 100755 index 000000000..13d4ad35b --- /dev/null +++ b/local-cli/wrong-react-native.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +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')); diff --git a/package.json b/package.json index 4e3811dbd..eaf176a38 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "start": "./packager/packager.sh" }, "bin": { + "react-native": "local-cli/wrong-react-native.js", "react-native-start": "packager/packager.sh" }, "dependencies": {