EISDIR after adding React Navigation to the project - javascript

I added react navigation to my project. I installed it like it is written in their docs, but it tells me:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:577:3)
at tryReadSync (fs.js:353:20)
at Object.readFileSync (fs.js:390:19)
at UnableToResolveError.buildCodeFrameMessage (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17)
at new UnableToResolveError (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35)
at ModuleResolver.resolveDependency (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (/Users/administrator/globo/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
at /Users/administrator/globo/node_modules/metro/src/lib/transformHelpers.js:317:42
at /Users/administrator/globo/node_modules/metro/src/Server.js:1471:14
at Generator.next (<anonymous>)
Here is my package.json:
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "expo start -c",
"test": "jest"
},
"dependencies": {
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"expo": "~40.0.0",
"expo-splash-screen": "~0.8.0",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "^0.64.0",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.0",
"react-native-unimodules": "^0.13.0",
"react-native-web": "^0.15.0"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1"
},
"jest": {
"preset": "react-native"
},
"private": true
}
I don't know what should I add, so please ask questions if you need. Please help. I am new in React Native.

Related

requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager

How to fix this error requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. in windows pc i have tried #Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
} but it didnt work and also tried .\gradlew clean both are not working in my case than how to fix it>
my package.json
{
"name": "letschat",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-navigation/bottom-tabs": "^6.3.3",
"#react-navigation/native": "^6.0.12",
"#react-navigation/native-stack": "^6.8.0",
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-safe-area-context": "^4.3.3",
"react-native-screens": "^3.17.0",
"socket.io-client": "^4.5.1"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"
}
}
Kill Metro and clean gradle build (it might take a minute or two):
cd android
.\gradlew clean
Start Metro and clear cache:
npm start --reset-cache
Recompile
npm run android

React Native Version Mismatch even though the package.json has the right version

I am developing an expo app with react native. However I suddenly started encountering the following error [ check print ]
"React Native version mismatch.
JavaScript version: 0.63.3
Native version: 0.64.2"
This error however doesn't appear on my console, only on the emulator.
This is my packge.json file
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest --watchAll",
"updateAppSyncLayer": "amplify api gql-compile && amplify codegen && babel src/graphql --extensions \".ts\" --config-file ./compile.babel.config.json -d ./amplify/backend/function/outgoingappawsgraphqlQueriesLayer/opt/graphql/"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"#aws-amplify/core": "^4.2.9",
"#babel/preset-typescript": "^7.15.0",
"#expo-google-fonts/montserrat": "^0.1.0",
"#expo/vector-icons": "^12.0.0",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/datetimepicker": "3.5.2",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/netinfo": "6.0.2",
"#react-navigation/bottom-tabs": "^5.11.1",
"#react-navigation/native": "^5.8.9",
"#react-navigation/stack": "^5.12.6",
"#types/react-native-autocomplete-input": "^5.0.0",
"#types/react-native-check-box": "^2.1.2",
"#types/react-native-datepicker": "^1.7.1",
"#types/react-native-read-more-text": "^1.0.0",
"#types/uuid": "^8.3.1",
"aws-amplify": "^4.2.9",
"aws-amplify-react-native": "^5.0.3",
"expo": "^43.0.0",
"expo-app-loading": "~1.2.1",
"expo-barcode-scanner": "~11.1.2",
"expo-contacts": "~10.0.3",
"formik": "^2.2.6",
"moment": "^2.29.1",
"react": "17.0.1",
"react-native": "0.63.3",
"react-native-autocomplete-dropdown": "^1.1.4",
"react-native-autocomplete-input": "^5.0.2",
"react-native-check-box": "^2.1.7",
"react-native-datepicker": "^1.7.2",
"react-native-dropdown-picker": "^5.1.21",
"react-native-gesture-handler": "~1.10.2",
"react-native-multiple-select": "^0.5.7",
"react-native-paper": "^4.8.1",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-svg": "^6.1.1",
"react-native-read-more-text": "^1.1.2",
"react-native-safe-area": "^0.5.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~3.8.0",
"react-native-svg": "12.1.1",
"uuid": "^8.3.2",
"yup": "^0.32.9"
},
"devDependencies": {
"#babel/cli": "^7.15.4",
"#babel/core": "^7.12.9",
"#babel/preset-env": "^7.15.6",
"#types/react": "~17.0.21",
"#types/react-native": "0.63.3",
"jest-expo": "^43.0.0",
"typescript": "~4.3.5"
},
"private": true
}
As you can see I have already set my react-native package to 0.63.3, uninstalled and reinstalled node-modules but I still get the error message.
What can I do?

Bundle error after upgrading Expo to SDK 42

I upgraded expo from sdk 39 to sdk 42 and I've got bundle error
Unable to resolve module ./TransitionProgressContext from E:\reactNative\BooKing\node_modules\react-native-screens\src\index.native.tsx:
it shows error with react-native-screens. I have it in version 3.4.0
Package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#react-native-firebase/app": "^8.4.7",
"#react-native-firebase/auth": "^9.3.5",
"#react-navigation/bottom-tabs": "^5.4.4",
"#react-navigation/native": "^5.3.2",
"#react-navigation/native-stack": "^6.1.0",
"#react-navigation/stack": "^5.3.5",
"expo": "^42.0.0",
"expo-app-loading": "^1.1.2",
"expo-barcode-scanner": "^10.2.2",
"expo-camera": "~11.2.2",
"expo-permissions": "^12.1.1",
"expo-status-bar": "^1.0.4",
"firebase": "^8.2.3",
"lottie-react-native": "~2.6.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-camera": "^3.43.0",
"react-native-gl-model-view": "^1.6.0",
"react-native-safe-area-context": "3.1.4",
"react-native-safe-module": "^1.2.0",
"react-native-screens": "~3.4.0",
"react-native-web": "~0.13.7",
"react-router-native": "^5.2.0",
"tcomb-form-native": "^0.6.20",
"unimodules-permissions-interface": "^6.1.0"
},
"devDependencies": {
"#babel/core": "~7.9.0"
},
"private": true
}
How to fix this problem? I don't know why it's appearing.
Problem solved. I needed just to clear cache with command expo r -c

unknown error when running react-native start

actually, when starting the app, using react-native run-android, it showed me an error "error Failed to run jetifier.", so i run with react-native run-android --no-jetifier, and when starting, it shows the following error:
D:\work\OMR_APP_GITHUB\node_modules\metro-hermes-compiler\src\emhermesc.js:77
throw ex;
^
Error: UNKNOWN: unknown error, lstat 'D:\work\OMR_APP_GITHUB\node_modules\.react-native-6bCcSflQ\React\Base\RCTModuleRegistry.m'
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (D:\work\OMR_APP_GITHUB\node_modules\sane\src\node_watcher.js:143:12)
at Walker.emit (events.js:400:28)
at D:\work\OMR_APP_GITHUB\node_modules\walker\lib\walker.js:52:12
at FSReqCallback.oncomplete (fs.js:192:21) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'lstat',
path: 'D:\\work\\OMR_APP_GITHUB\\node_modules\\.react-native-6bCcSflQ\\React\\Base\\RCTModuleRegistry.m'
}
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
i tried the solution in this post > React Native start failed with error code -4094 how to solve this ONCE for ALL?
and it still doesn't work, i also tried to remove the node modules, but, it gets the error:
0x80070570, the file or directory is corrupted and unreadable.
this is my package.json:
{
"name": "OMR_APP",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.11",
"#react-native-firebase/app": "^12.8.0",
"#react-navigation/native": "^6.0.2",
"#react-navigation/native-stack": "^6.1.0",
"app-icon": "^0.13.2",
"formik": "^2.2.9",
"install": "^0.13.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-native": "0.65.1",
"react-native-camera": "^4.2.1",
"react-native-document-picker": "^6.0.4",
"react-native-dropdown-picker": "^5.1.28",
"react-native-elements": "^3.4.2",
"react-native-form-validator": "^0.1.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-ico-material-design": "^3.3.1",
"react-native-paper": "^4.9.2",
"react-native-reanimated": "^2.2.2",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.7.2",
"react-native-simple-radio-button": "^2.7.4",
"react-native-svg": "^12.1.1",
"react-native-vector-icons": "^8.1.0",
"yup": "^0.32.9"
},
"devDependencies": {
"#babel/core": "^7.15.5",
"#babel/runtime": "^7.15.4",
"#react-native-community/eslint-config": "^3.0.1",
"babel-jest": "^27.2.0",
"eslint": "^7.32.0",
"jest": "^27.2.0",
"jetifier": "^2.0.0",
"metro-react-native-babel-preset": "^0.66.2",
"react-native-codegen": "^0.0.7",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}

Unable to run my Expo app on LAN React Native

I've updated my expo version to the latest. but unfortunately I don't know why my LAN is not working and expo. I've already tried lots of things example.
expo r -c
Delete node_modules and then npm install
but nothing works for me.
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"axios": "^0.19.0",
"expo": "^35.0.0",
"expo-device": "~1.0.0",
"expo-font": "~7.0.0",
"native-base": "^2.13.8",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-dialog": "^5.6.0",
"react-native-gesture-handler": "~1.3.0",
"react-native-material-menu": "^1.0.0",
"react-native-modal": "^11.5.3",
"react-native-modal-filter-picker": "^1.3.4",
"react-native-multiple-select": "^0.5.5",
"react-native-paper": "^3.2.1",
"react-native-reanimated": "~1.2.0",
"react-native-simple-radio-button": "^2.7.4",
"react-native-web": "^0.11.7",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.3.3",
"react-navigation-stack": "^1.10.3"
},
"devDependencies": {
"babel-preset-expo": "^7.1.0"
},
"private": true
}
please try to update following in package.json
"expo-cli": "3.11.5"
Then remove node_modules
npm install

Categories