Unable to resolve module 'react-native-screen'

Pierre-olivier Dubois-Nadeau picture Pierre-olivier Dubois-Nadeau · Dec 24, 2019 · Viewed 36.2k times · Source

I got this error from React Native on Atom:

Unable to resolve module 'react-native-screen'

Here are my steps:

  1. I ran npm install --save react-navigation, and I got the following:

Result of running npm install --save react-navigation

  1. Then I ran npm install:

Result of running npm install

And after, when I run my application, I get an error:

Unable to resolve "react-native-screens" from "node_modules\react-navigation-stack\lib\module\views\StackView\StackViewCard.js"
Failed building JavaScript bundle.

Answer

Tuan Luong picture Tuan Luong · Dec 25, 2019

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