Unable to resolve module 'react-native-screen'

If you have downloaded react-navigation then it wont work without its supporting Libs which are react-native-gesture-handler ,react-native-reanimated, react-native-screens

you can download it via yarn or npm .

npm install  react-native-gesture-handler react-native-reanimated react-native-screens

or

yarn add react-native-gesture-handler react-native-reanimated react-native-screens

Hope it helps. feel free for doubts


You need to install 3 more libs react-native-gesture-handler, react-native-reanimated, and react-native-screens.

npm install --save react-native-gesture-handler react-native-reanimated react-native-screens

Refs: https://reactnavigation.org/docs/en/getting-started.html#installing-dependencies-into-a-bare-react-native-project


Use below steps, this will work 100%.

  1. Install React Navigation

npm install react-navigation

  1. Install Dependencies

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

  1. Install React Navigation Stack

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

  1. Start the app and clear cache with npm start -c

Update Imports

imports  will  look like this:
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';

Errors? If you are still seeing errors and complaints about packages, do the following:

  1. rm -r node_modules

  2. rm package-lock.json

  3. expo upgrade

  4. npm start -c