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.1node -v
: v8.4.0npm -v
: 5.3.0yarn --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_modules
directory tonode_modules_
. - Delete
android
directory. - 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-cache
saved the day for me: https://github.com/facebook/react-native/issues/1924#issuecomment-249861004Also, delete
system32
I’m having the same problem. It’s pointing to package.json files in directories that no longer exists. Have tried
npm cache clean
yarn cache clean
etc… 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-all
Unfortunately, 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-cache
does work! But, after it has executed we need to kill this command and start with the usual onereact-native run-android
.watchman
didn’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! 😛