-
Notifications
You must be signed in to change notification settings - Fork 279
Peer Dependency Errors #1339
Unanswered
kaili-kameoka
asked this question in
Q&A
Peer Dependency Errors
#1339
-
I'm unable to install the package because of peer dependencies. I've tried following the suggestion on issue #1238, but it I continue to have peer dependency errors. Any other suggestions?
Here is the error message:
'Log files: /Users/kailikameoka/.npm/_logs/2023-02-20T23_21_14_921Z-debug-0.log # npm resolution error report While resolving: native-portal@1.0.0 Found: react@18.1.0 node_modules/react react@"18.1.0" from the root project peer react@">=16.8.0" from @testing-library/react-native@12.0.0-rc.0 node_modules/@testing-library/react-native dev @testing-library/react-native@"*" from the root project peer react@"18.1.0" from react-native@0.70.5 node_modules/react-native react-native@"0.70.5" from the root project peer react-native@">=0.59" from @testing-library/react-native@12.0.0-rc.0 node_modules/@testing-library/react-native dev @testing-library/react-native@"*" from the root project Could not resolve dependency: peer react@"^18.2.0" from react-test-renderer@18.2.0 node_modules/react-test-renderer dev react-test-renderer@"^18.0.0" from the root project peer react-test-renderer@">=16.8.0" from @testing-library/react-native@12.0.0-rc.0 node_modules/@testing-library/react-native dev @testing-library/react-native@"*" from the root project Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
pckage.json dependencies
:
{ "dependencies": { "@react-navigation/native": "^6.1.4", "expo": "~47.0.12", "expo-status-bar": "~1.4.2", "native-base": "^3.4.25", "react": "18.1.0", "react-dom": "18.1.0", "react-native": "0.70.5", "react-native-safe-area-context": "4.4.1", "react-native-screens": "~3.18.0", "react-native-svg": "13.4.0", "react-native-web": "~0.18.9" }, "devDependencies": { "@babel/core": "^7.12.9", "@types/jest": "^29.4.0", "@types/react": "~18.0.14", "@types/react-native": "~0.70.6", "@typescript-eslint/eslint-plugin": "^5.48.2", "eslint": "^8.32.0", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.6.0", "eslint-config-react-app": "^7.0.1", "eslint-config-standard-with-typescript": "^31.0.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-n": "^15.6.1", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react": "^7.32.1", "react-test-renderer": "^18.0.0", "typescript": "^4.6.3" } }
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
@kaili-kameoka as a general recommendation you should use exact package versions for react
, react-native
and react-test-renderer
packages. Additionally you should meet following condtions:
react-native
package version should be accompanied by correspondingreact
package version. For correct mapping you can use React Native Upgrade Helperreact
andreact-test-renderer
should use the same exact version
So for your case this would mean:
"react-native": "0.70.5", "react": "18.1.0", "react-test-renderer": "18.1.0",
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment