I recently reinstalled all npm packages used in my React Native app (using expo dev client) and when I ran the app again (npx expo start --dev-client
), it returned an error:
iOS Bundling failed (node_modules/expo/AppEntry.js)
The package at "node_modules/@babel/core/lib/gensync-utils/fs.js" attempted to import the Node standard library module "fs".
It failed because the native React runtime does not include the Node standard library.
Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-libraries
I’ve tried deleting node_modules
, package-lock.json
and reinstalling all packages and ran npx expo start --clear
but to no avail.
Here’s my package.json:
"name": "h-app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"dev": "npx expo start --dev-client",
"iosbuild": "eas build --profile development-simulator --platform ios"
},
"dependencies": {
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"expo": "~50.0.14",
"expo-dev-client": "~3.3.11",
"expo-secure-store": "~12.8.1",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-device-info": "^10.13.2",
"react-native-rsa": "^0.0.3",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-uuid": "^2.0.2",
"socket.io-client": "^4.7.5",
"swiftui-react-native": "^5.0.0"
},
"private": true,
"devDependencies": {
"@babel/core": "^7.24.6"
}
}