9

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.com/react-community/react-navigation/issues/1846

https://github.com/facebook/react-native/issues/4968/

enter image description here

Please help me resolve the issue. Thanks in advance.

1
  • Did you try resetting the packager cache? Commented Sep 1, 2017 at 7:53

5 Answers 5

1

Try 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 command

 npm install modules_name

for every module

Thanks

Sign up to request clarification or add additional context in comments.

Comments

0

see Path to react/lib/ReactComponentWithPureRn. It not find path.

Comments

0

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.

Comments

0

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

Comments

0

I was having similar issue. What I found to fixed the issue for me was.

  1. Run code in terminal

    npm i react-navigation-stack

  2. Run the below code by opening terminal in your project directory

    npm install react-navigation-stack @react-native-community/masked-view react-native-safe-area-context

  3. Lastly running expo clearing the cache(Did this for good measure).

    expo start -c

    Ref: https://www.npmjs.com/package/react-navigation-stack

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.