This is my first React Native project. The repo is here.
When I start up expo, I get the error:
Cannot find module 'babel-preset-react'
Among others, it has these dependencies:
"expo": "^32.0.0",
"react": "16.8.4",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz",
"@babel/core": "7.3.4",
"babel-core": "^7.0.0-bridge.0",
"@babel/preset-react": "^7.0.0",
I found these four libraries in my app's /node_modules that each contain a dev dependency on "babel-preset-react":
hoist-non-react-statics, prop-types, react-input-autosize and react-proxy.
None of these have newer versions that depend on "@babel/preset-react".
I had this a few, every time I install a new module/plugin. My solution has been to delete node_modules folder and yarn install or npm install.
It stops the error. I'm not sure is the right solution (would be interested to know if it is), but works.
This seems to be an issue to do with an expo project being in a bad state.
Expo is an express set of libs with the goal of simplifying development, but it is not compatible with most react native examples in the wild.
After further review, it looks like you may have followed a regular react native example in an Expo based project, without first ejecting.
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