I am new to react native and trying to add google maps to my project.
Error: Unable to resolve module react-native-maps from C:\...\MapSearch.js:
react-native-maps could not be found within the project or in these directories:
node_modules
Used dependency: npm install react-native-maps --save
Links followed: https://www.npmjs.com/package/react-native-maps
My error is as follows:
code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: appname#0.0.1
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"17.0.1" from the root project
npm ERR! peer react#">= 16.0 || < 17.0" from react-native-maps#0.28.0
npm ERR! node_modules/react-native-maps
npm ERR! react-native-maps#"^0.28.0" from the root project
npm ERR! 2 more (react-native, react-native-web)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.2" from react-dom#17.0.2
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">=16.5.1" from react-native-web#0.11.7
npm ERR! node_modules/react-native-web
npm ERR! peer react-native-web#"^0.11" from react-native-maps#0.28.0
npm ERR! node_modules/react-native-maps
npm ERR!
react-native-maps#"^0.28.0" from the root project
try to Delete npm_modules folder and reinstall all node modules
Related
In my react native project, I want to install React Native Firebase Auth but I got error after running this command:
npm i #react-native-firebase/auth
The error :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: KengTung#0.0.1
npm ERR! Found: #react-native-firebase/app#16.5.1
npm ERR! node_modules/#react-native-firebase/app
npm ERR! peer #react-native-firebase/app#"16.5.1" from #react-native-firebase/database#16.5.1
npm ERR! node_modules/#react-native-firebase/database
npm ERR! #react-native-firebase/database#"^16.5.1" from the root project
npm ERR! peer #react-native-firebase/app#"16.5.1" from #react-native-firebase/storage#16.5.1
npm ERR! node_modules/#react-native-firebase/storage
npm ERR! #react-native-firebase/storage#"^16.5.1" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #react-native-firebase/auth#"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #react-native-firebase/app#16.7.0
npm ERR! node_modules/#react-native-firebase/app
npm ERR! peer #react-native-firebase/app#"16.7.0" from #react-native-firebase/auth#16.7.0
npm ERR! node_modules/#react-native-firebase/auth
npm ERR! #react-native-firebase/auth#"*" from the root project
npm ERR!
Try this :
npm config set legacy-peer-deps true
npm i
If i want to add "npm install #react-native-community/async-storage" in the terminal.
There is this error and i dont know why.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: react#16.14.0
npm ERR! node_modules/react
npm ERR! react#"^16.13.0" from the root project
npm ERR! peer react#"^16.8" from #react-native-community/async-storage#1.12.1
npm ERR! node_modules/#react-native-community/async-storage
npm ERR! #react-native-community/async-storage#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"18.1.0" from react-native#0.70.6
npm ERR! node_modules/react-native
npm ERR! peer react-native#">=0.59" from #react-native-community/async-storage#1.12.1
kjf Is it maybe of my react version. If yes how can I change my version
you have to change your react version to resolve this error.
using npm install react#[version] --save cmmand you can change your react Version.
Try using this #react-native-async-storage/async-storage package
npm install not working I am facing this error logs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving:xxx#0.0.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR! peer react#"*" from react-native-country-picker-modal#2.0.0
npm ERR! node_modules/react-native-country-picker-modal
npm ERR! react-native-country-picker-modal#"^2.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^18.2.0" from react-dom#18.2.0
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#"*" from react-native-country-picker-modal#2.0.0
Resolved this error by using
npm install --force
npm install --legacy-peer-deps
or
we can use yarn install in some cases yarn works
Right now my current project is using an old version of webpack (3.5.1) and I need to update it to a version that can understand object spread because an npm module would not compile because of older webpack version.
If I run npm update webpack I get the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: css-loader#1.0.1
npm ERR! Found: webpack#3.5.1
npm ERR! node_modules/webpack
npm ERR! webpack#"3.5.1" from the root project
npm ERR! peer webpack#"2 || 3" from babel-loader#7.1.1
npm ERR! node_modules/babel-loader
npm ERR! babel-loader#"7.1.1" from the root project
npm ERR! 10 more (extract-text-webpack-plugin, file-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^4.0.0" from css-loader#1.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"1.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^4.0.0" from css-loader#1.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"1.0.1" from the root project
I tried to force update but it didn't work either.
Fresh install expo init firstapp then next npm install native-base. I encounter error like this below. I tried deleting node_modules and tried also deleting expo cli I have no success.
Anyone encounter this?
PS E:\Projects\ReactNative\firstapp> npm install native-base
>>
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#16.13.1
npm ERR! node_modules/react
npm ERR! peer react#"^16.13.1" from react-dom#16.13.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">=16.5.1" from react-native-web#0.13.18
npm ERR! node_modules/react-native-web
npm ERR! react-native-web#"~0.13.12" from the root project
npm ERR! react-dom#"16.13.1" from the root project
npm ERR! peer react#"*" from react-native-safe-area-context#3.2.0
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context#"3.2.0" from expo#41.0.1
npm ERR! node_modules/expo
npm ERR! expo#"~41.0.1" from the root project
npm ERR! 5 more (react-native-web, use-subscription, the root project, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native-windows#0.64.8
npm ERR! node_modules/native-base/node_modules/react-native-windows
npm ERR! peer react-native-windows#">=0.62" from #react-native-community/datetimepicker#3.5.0
npm ERR! node_modules/native-base/node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"^3.0.2" from native-base#2.15.2
npm ERR! node_modules/native-base
npm ERR! native-base#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\XXX\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\XXX\AppData\Local\npm-cache\_logs\2021-05-23T08_04_02_291Z-debug.log
Looks like maybe the solution to your problem might be to use a compatible version of native base with your react native version see table in native base documentation on the Compatibility Versions section.