Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native compile error on resolving module

Tags:

react-native

I can't compile my project because of this error.

Unable to resolve module @react-navigation/core from node_modules\@react-navigation\native\src\createAppContainer.js:

When I run I encounter with this problem. Can anybody help me?

like image 254
Roa Avatar asked Feb 11 '20 10:02

Roa


People also ask

How do I fix unable to resolve module react-native-gesture-handler?

This error occurs for two main reasons. If you didn't install react-native-gesture-handler , then npm or yarn install react-native-gesture-handler . If you already did, then you need to rebuild your app, for android react-native run-android and for ios you should install pods then run again.

What is react native linking?

Linking gives you a general interface to interact with both incoming and outgoing app links. Every Link (URL) has a URL Scheme, some websites are prefixed with https:// or http:// and the http is the URL Scheme. Let's call it scheme for short.


2 Answers

Sometimes such error occurs as the package-json.lock file which locks the version.

So do 1 thing remove the version of @react-navigation and all related dependencies from your package.json and after that do following once again

npm install @react-navigation/native --save

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

Must help!

like image 50
TARJU Avatar answered Oct 20 '22 17:10

TARJU


This error means that either you haven't installed the react-navigation module or that you have installed the module but didn't re-built your project using react-native run-android or react-native run-ios.

Following these steps should solve your issue:

  • Install react-navigation module.

  • Re-build your project.

  • Restart the packager by stopping the current packager and then starting the packager again

  • with react-native start.

like image 2
Biblbroks42 Avatar answered Oct 20 '22 17:10

Biblbroks42