react-native: Ambiguous resolution of react-native
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
- react-native -v: 2.0.1
- node -v: v8.4.0
- npm -v: 5.3.0
- yarn --version:
Then, specify:
- Target Platform: Android
- Development Operating System: Windows 10 Home
- Build tools: Android Studio
Steps to Reproduce
(Write your steps here:)
- Rename node_modulesdirectory tonode_modules_.
- Delete androiddirectory.
- Execute npm i
- Execute react-native upgrade
- Execute react-native run-android
After not working I even deleted the node_modules_ directory. But the problem still persists.
Expected Behavior
It should just work as expected, run the app in the Android emulator.
Actual Behavior
It’s not working. React packager is complaining.
Reproducible Demo
https://github.com/ManvendraSK/ChatNowReactNativeSampleApp
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 27 (5 by maintainers)
@ManvendraSK
npm start -- --reset-cachesaved the day for me: https://github.com/facebook/react-native/issues/1924#issuecomment-249861004Also, delete
system32I’m having the same problem. It’s pointing to package.json files in directories that no longer exists. Have tried
npm cache cleanyarn cache cleanetc… Keeps trying to resolve the react_native module to the non-existent dirs.Any idea when this will be solved? For now I cannot install any pods that install React as well.
Reboot mac works
i tried to install, npm install --save react-native-router-flux@3.38.0 npm install -g react-native-git-upgrade react-native-git-upgrade
fixed thanks folks
@ManvendraSK try
watchman watch-del-allUnfortunately, it did not help me 😞Generally this issue arises when there are two folders of react-native. More often, if you use Pods, you have dependency that relies on the ‘React’ pod and thus you should reference the pod in your node_modules/ not install anothe react-native from cocopods. To do so, you can add the following to your Podfile
For me the error appeared in calling my Project ReactNative! As soon as I changed the name to something different than ./ReactNative the error disappeared!
Hey @jonathanoron and @radko93, it’s working fine!
npm start -- --reset-cachedoes work! But, after it has executed we need to kill this command and start with the usual onereact-native run-android.watchmandidn’t work though!Thanks, guys. You both are Batman for me!
@jonathanoron I’ll try when back at home, right now in office 😉.
Let’s see what is next, I’ll keep you posted here. May be somebody would help like Batman! 😛