I’m trying to build the apk for my react native project but i’m getting the following error each time the build gets to the ‘createBundleAmazonReleaseJsAndAssets’ task:
Error: Unable to resolve module .node_modulesexpoAppEntry.js from C:UserstoseyGlaucaAI/.: .node_modulesexpoAppEntry.js could not be found within the project or in these directories:
node_modules
..node_modules
at ModuleResolver.resolveDependency (C:UserstoseyGlaucaAInode_modulesmetrosrcnode-hasteDependencyGraphModuleResolution.js:138:15)
I can’t seem to pass this stage and build successfully. Please help
Here is my package.json file:
{
"name": "GlaucaAI",
"version": "0.8.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"writeAssetsBundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
"buildAppAPK": "cd android && ./gradlew clean && ./gradlew assembleRelease --warning-mode=all --stacktrace --scan --info",
"buildAppAAB": "cd android && ./gradlew clean && ./gradlew bundleRelease --warning-mode=all --stacktrace --scan --info",
"dependencyConflict": "cd android && ./gradlew app:dependencyInsight --configuration amazonReleaseRuntimeClasspath --dependency your-dependency-name",
"start": "npx expo start",
"begin": "npm exec expo start",
"dev:build:ios": "eas build --profile development --platform ios",
"dev:build:android": "eas build --profile development --platform android",
"test": "jest",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@expo/vector-icons": "^14.0.0",
"@expo/webpack-config": "~19.0.1",
"@google/generative-ai": "^0.1.2",
"@pubnub/react-native-chat-components": "0.27.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-native-picker/picker": "2.7.5",
"@react-native/metro-config": "^0.74.84",
"@react-navigation/bottom-tabs": "^6.5.8",
"@react-navigation/material-top-tabs": "^6.6.3",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"@stripe/stripe-react-native": "0.37.2",
"axios": "^1.4.0",
"babel-preset-expo": "^11.0.8",
"deepai": "^1.0.23",
"expo": "^51.0.12",
"expo-av": "~14.0.5",
"expo-build-properties": "~0.12.3",
"expo-constants": "~16.0.2",
"expo-device": "~6.0.2",
"expo-document-picker": "~12.0.1",
"expo-file-system": "~17.0.1",
"expo-font": "~12.0.7",
"expo-image-picker": "~15.0.5",
"expo-in-app-purchases": "~14.3.0",
"expo-linking": "~6.3.1",
"expo-local-authentication": "~14.0.1",
"expo-notifications": "~0.28.7",
"expo-permissions": "~14.2.1",
"expo-print": "~13.0.1",
"expo-sharing": "~12.0.1",
"expo-splash-screen": "~0.27.5",
"expo-sqlite": "~14.0.3",
"expo-status-bar": "~1.12.1",
"expo-tracking-transparency": "~4.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.2",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.16.1",
"react-native-iap": "12.13.0",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-joyride": "^1.0.1",
"react-native-keychain": "^8.1.2",
"react-native-marquee-ab": "^1.2.6",
"react-native-pager-view": "6.3.0",
"react-native-paper": "^5.11.3",
"react-native-pdf": "^6.7.1",
"react-native-reanimated": "^3.12.0",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-secure-key-store": "^2.0.10",
"react-native-sqlite-storage": "^6.0.1",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^3.5.2",
"react-native-vector-icons": "^10.1.0",
"react-native-web": "~0.19.10",
"react-native-webview": "13.8.6",
"rn-sliding-up-panel": "^2.4.6",
"text-encoding": "^0.7.0",
"yarn": "^1.22.22"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/plugin-transform-class-properties": "^7.24.7",
"@babel/plugin-transform-private-methods": "^7.24.7",
"babel-plugin-module-resolver": "^5.0.2",
"@types/jest": "25.2.3",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "17.0.1",
"babel-jest": "27.0.6",
"eslint": "7.32.0",
"jest": "^29.4.0",
"metro": "^0.80.9",
"metro-config": "^0.80.9",
"metro-react-native-babel-preset": "^0.77.0",
"metro-react-native-babel-transformer": "^0.77.0",
"typescript": "^5.1.3"
},
"private": true
}
The ‘metro-react-native-babel-transformer’ module was recommended to resolve the ‘.node_modulesexpoAppEntry.js’ but it didn’t work for me.
Is there anything i’m not doing right? Is there any conflict that i need to remove for my project to build successfully? I’m so confused right now.
I have deleted the ‘node_modules’ several times and run ‘yarn’ to install all the packages again and again but still getting the same error.
I have deleted the ‘node_modules’ several times and run ‘yarn’ to install all the packages again and again but still getting the same error.