Unable To Resolve Module 'react-navigation' From .../App.js: Module 'react-navigation' Does Not Exist In The Haste Module Map
I have just setup an app to start building it out and I keep getting this error from my App.js. This is a part of a udemy course in which I have followed every instruction to a T..
Solution 1:
Make sure to install react-navigation with npm i react-navigation
Solution 2:
First of all you have to use CMD to run this commands.
- If your system is Windows, set your environment variable, add
%SystemRoot%\system32
to yourPATH
I met this error yesterday,hope it works to you. Don't forget to reboot you PC.
After that :
- Create your project :
npx expo-cli init <projectname>
Then :
Install React Navigation :
npm install react-navigation
Install Dependencies :
expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
Install React Navigation Stack :
npm install react-navigation-stack @react-native-community/masked-view
Start the app and clear cache with
npm start -c
.
Update Imports Our imports in the upcoming lecture will now 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
Solution 3:
Do this it will definitely work :
npm install --legecy-peer-deps react-navigation
or
npm install --legecy-peer-deps react-navigation --force
Post a Comment for "Unable To Resolve Module 'react-navigation' From .../App.js: Module 'react-navigation' Does Not Exist In The Haste Module Map"