'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:

  1. clean the npm cache using the following command : npm cache clean --force
  2. re-install the dependencies : npm install
  3. 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 your react-native-gesture-handler to
  • "react-native-gesture-handler": "~1.10.2", (for expo 43.0.2)
  1. Then, on your terminal (in your project), run
  • npm cache clean --force
  • npm install
  • expo 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