question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Looks like you installed react-native globally, maybe you meant react-native-cli?

See original GitHub issue

Description

After ejecting, none of the react-native tasks seem to work. I’m not sure if this problem is related to create-react-native-app (or at least could be solved here), but I would like to report it anyway.

Expected Behavior

I guess it should just work.

Observed Behavior

Got the folling message:

Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
error Command failed with exit code 1.

Even after running those commands, the problem is still here.

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: (empty)
  • npm ls react-native: 0.46.1 (tried 0.47.1 too)
  • npm ls expo:
  • node -v: 8.3.0
  • npm -v: 5.3.0
  • yarn --version: 0.27.5
  • watchman version: 4.9.0

Also specify:

  1. Operating system: Windows

Reproducible Demo

  1. Create new project with create-react-native-app
  2. Run eject
  3. Run android or any other task

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:14
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
gbarkhatovcommented, Jan 9, 2018

I confirm:

"android": "node node_modules/react-native/local-cli/cli.js run-android"

works fine

4reactions
njbmartincommented, Dec 11, 2017

I can confirm the same. I followed all the create-react-native-app instructions on my mac, ejected. Build and ran fine on Mac using "start": "react-native start",. Then moved over to my PC and had the same issue described above. changed it to '“start”: “node node_modules/react-native/local-cli/cli.js start”` and it now works as expected.

These could do with being updated: https://github.com/react-community/create-react-native-app/blob/7203fc975b0cfeba38d136c4414a0ca26807162b/react-native-scripts/src/scripts/eject.js#L196

Read more comments on GitHub >

github_iconTop Results From Across the Web

Looks like you installed react-native globally - Stack Overflow
Use this in package.json "scripts": { "android": "node node_modules/react-native/local-cli/cli.js run-android" }. instead of
Read more >
Node.js - Looks like you installed react-native globally
There appears to be a bug with react-native, when it is installed globally. I need it to execute properly without seeing this error:...
Read more >
Setting up the development environment - React Native
This page will help you install and build your first React Native app. If you are new to mobile development, the easiest way...
Read more >
Looks like you installed react-native globally, maybe you ...
Looks like you installed react -native globally, maybe you meant ... After ejecting, none of the react-native tasks seem to work. I'm not ......
Read more >
How to Install Expo and the React Native CLI - YouTube
Setting up React native on your machine can be a bit of a pain. This video will walk you through the installation and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found