'Cannot find module 'expo/bundleNativeModules.json'
I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated. I get a couple of warnings that says:
Some of your project's dependencies are not compatible with currently installed expo package version
- expo-constants - expected version range: ...
- expo-permissions - expected version range: ...
- react-native-gesture-handler - expected version range: ...
Your project may not work correctly until you install the correct versions of the packages.
I was facing another error:
"TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')".
So I'm trying to install the latest version.
When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors.
Both errors say
Cannot find module 'expo/bundledNativeModules.json' Require stack: - /Users/address/src/react-native-udacicards/noop.js
I tried to remove node_modules and package-lock.json then npm install.
Solution 1:[1]
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me:
- clean the npm cache using the following command : npm cache clean --force
- re-install the dependencies : npm install
- expo install
I hope it helps
Solution 2:[2]
1.on your package.json change expo version to
"expo": "~43.0.2", (or lower) and yourreact-native-gesture-handlerto"react-native-gesture-handler": "~1.10.2", (for expo 43.0.2)
- Then, on your terminal (in your project), run
npm cache clean --forcenpm installexpo doctor --fix-dependencies
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mahmoud mehdi |
| Solution 2 | Jeremy Caney |
