react-native: v0.15.0 - Inaccurate error with "Looks like you installed react-native globally"

Seems to be an odd bug when running with npm start vs. react-native start (perhaps due to it using react-native from the ./node_modules/.bin/react-native folder?

screen shot 2015-12-02 at 9 49 50 pm screen shot 2015-12-02 at 9 48 22 pm

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

one workaround is to npm install --save-dev react-native-cli

npm start is defined in your package.json, "start": "react-native start" is wrong due to a bug I introduced in an older version of the global CLI, please change that to:

{
  "name": "MyApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react-native": "rn_version_you_are_using"
  }
}

The new global CLI will generate package.json like that, sorry about the breakage!

To upgrade:

 npm uninstall -g react-native-cli
 npm install -g react-native-cli

(and fix package.json for all your apps)

If this doesn’t resolve the issue let’s reopen.

I don’t understand why "react-native-cli" would be in the dependencies or dev dependencies of your app. Your app doesn’t need the CLI.