-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.15.0 - Inaccurate error with "Looks like you installed react-native globally" #4515
Comments
This is from a fresh |
You can also see I don't have it installed globally per the recommended uninstallation of global package (so this is why I mention it is inaccurate). |
Hey niftylettuce, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
@niftylettuce Which package do you have installed globally? |
react native cli
|
I can repro this too but not sure about the cause. |
I think its because package.json loads node_modules/.bin as environment
|
I'm getting the same error on |
one workaround is to |
@gre thank you so much for that workaround. Fixed the issue for me. I'm only seeing this problem when building on a Mac via Jenkins. Not locally on any dev machine. |
Okay, some steps to reproduce (Mac OS X 10.11.2, npm 3.5.2, nodejs 5.3.0). cd /tmp
npm install -g react-native-cli
react-native init test
cd test
ls -l /usr/local/bin | grep react # react-native -> ../lib/node_modules/react-native-cli/index.js
ls -l node_modules/.bin | grep react # react-native -> ../react-native/local-cli/wrong-react-native.js
npm run start # Looks like you installed react-native globally, maybe you meant react-native-cli? This happens because npm prepends npm install --save-dev react-native-cli
ls -l /usr/local/bin | grep react # react-native -> ../lib/node_modules/react-native-cli/index.js
# bingo, it's working However, will this also work on a fresh machine? rm -Rf node_modules
npm install
ls -l node_modules/.bin | grep react # react-native -> ../react-native/local-cli/wrong-react-native.js
# Oops, not working again At this moment, {
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start"
},
"dependencies": {
"react-native": "^0.18.0-rc"
},
"devDependencies": {
"react-native-cli": "^0.1.10"
}
} Remove "dependencies": {
"react-native-cli": "^0.1.10",
"react-native": "^0.18.0-rc"
} Then run rm -Rf node_modules
npm install
ls -l /usr/local/bin | grep react # react-native -> ../lib/node_modules/react-native-cli/index.js
# bingo, it's working Putting So until this gets fixed, the only reliable way seems to be to either list |
cc @mkonicek |
The new global CLI will generate package.json like that, sorry about the breakage! To upgrade:
(and fix package.json for all your apps) If this doesn't resolve the issue let's reopen. I don't understand why |
@mkonicek Thanks! |
@mkonicek thanks for sharing! |
I had the same issue even after uninstalling |
Seems to be an odd bug when running with
npm start
vs.react-native start
(perhaps due to it usingreact-native
from the./node_modules/.bin/react-native
folder?The text was updated successfully, but these errors were encountered: