Looks like you installed react-native globally, maybe you meant react-native-cli?
See original GitHub issueDescription
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.0npm -v
: 5.3.0yarn --version
: 0.27.5watchman version
: 4.9.0
Also specify:
- Operating system: Windows
Reproducible Demo
- Create new project with
create-react-native-app
- Run
eject
- Run
android
or any other task
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:9 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I confirm:
"android": "node node_modules/react-native/local-cli/cli.js run-android"
works fine
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