Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error: missing babel-preset-expo in expo mobile app

I'm new to react-native and am in the early stages of creating an app with Expo. I had a working app until installing redux. Currently I am getting the following error from the XDE:

Problem checking node_modules dependencies: Unexpected end of JSON input

and the following from the ios simulator:

Building JavaScript bundle: error
TransformError: ../app/main.js: Couldn't find preset "babel-preset-expo" relative to directory "../app/"

I believe my node modules contain valid JSON. It should be noted that I'm using a more current version of react-native than expo.

like image 689
Patrick Connors Avatar asked Oct 23 '25 14:10

Patrick Connors


1 Answers

I experienced this issue when I tried moving to expo version 21.0.0.

You should try to delete your node modules and use yarn to install.

package.json 
  dependencies:{
   "babel-preset-expo" : "^4.0.0",
   "expo": "^21.0.0",
   "react-native": "https://github.com/expo/react-native/archive/sdk-21-0.2.tar.gz"
 }

my .babelrc

{
 "presets": ["babel-preset-expo"],
 "env": {
   "development": {
     "plugins": ["transform-react-jsx-source"]
    }
 }
}
like image 165
Jolaade Adewale Avatar answered Oct 26 '25 08:10

Jolaade Adewale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!