I am beginner in react-native and I am getting below error, when I install and try to use react-navigation import {StackNavigator} from 'react-navigation'; I have tried a lot of link to resolve this but didn't find any solution. Below are the links:
Unable to resolve 'react-navigation'
/
Please help me resolve the issue. Thanks in advance.
I am beginner in react-native and I am getting below error, when I install and try to use react-navigation import {StackNavigator} from 'react-navigation'; I have tried a lot of link to resolve this but didn't find any solution. Below are the links:
Unable to resolve 'react-navigation'
https://github./react-munity/react-navigation/issues/1846
https://github./facebook/react-native/issues/4968/
Please help me resolve the issue. Thanks in advance.
Share Improve this question asked Sep 1, 2017 at 7:11 Deepak SachdevaDeepak Sachdeva 1,0109 silver badges18 bronze badges 1- Did you try resetting the packager cache? – Kraylog Commented Sep 1, 2017 at 7:53
5 Answers
Reset to default 1Try this Working for me
npm install @react-navigation/native @react-navigation/stack
Import like this
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
OR
Please make sure you are not getting any error in your terminal like this
Error: Unable to resolve module `**modules_name**` from `node_modules\
that can be the cause of that.
if you are getting please follow the mand
npm install modules_name
for every module
Thanks
see Path to react/lib/ReactComponentWithPureRn. It not find path.
I face same problem now.
How to fix
When I look the node modules
folder I can't see the react-navigation module.
Then I re-install the module with # npm install --save react-navigation
After restart the bundler with npm start
it worked.
i face this problem and fixed it in this way:
According to document we must install all dependencies like :
react-native-gesture-handler, react-native-reanimated, react-native-screens and react-native-safe-area-context
I was having similar issue. What I found to fixed the issue for me was.
Run code in terminal
npm i react-navigation-stack
Run the below code by opening terminal in your project directory
npm install react-navigation-stack @react-native-munity/masked-view react-native-safe-area-context
Lastly running expo clearing the cache(Did this for good measure).
expo start -c
Ref: https://www.npmjs./package/react-navigation-stack