I got this error from React Native on Atom:
Unable to resolve module 'react-native-screen'
Here are my steps:
npm install --save react-navigation
, and I got the following: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.
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%.
npm install react-navigation
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
npm install react-navigation-stack @react-native-community/masked-view
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:
rm -r node_modules
rm package-lock.json
expo upgrade
npm start -c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With