Install AsyncStorage React Native doesnt work - react-native

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

Related

React Native deck swiper library not working

I am trying to install the react native deck swiper using npm and I am getting the following error. Guys is the something wrong with this library "npm install react-native-deck-swiper" and if there is how do we fix it?
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-deck-swiper#2.0.8
npm ERR! Found: react-native#0.69.5
npm ERR! node_modules/react-native
npm ERR! peer react-native#"" from #react-native-community/cli#8.0.6
npm ERR! node_modules/#react-native-community/cli
npm ERR! #react-native-community/cli#"^8.0.4" from react-native#0.69.5
npm ERR! peer react-native#"" from #react-navigation/elements#1.3.5
npm ERR! node_modules/#react-navigation/elements
npm ERR! #react-navigation/elements#"^1.3.5" from #react-navigation/native-stack#6.8.0
npm ERR! node_modules/#react-navigation/native-stack
npm ERR! #react-navigation/native-stack#"^6.8.0" from the root project
npm ERR! 6 more (#react-navigation/native, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native#"^0.49.1" from react-native-deck-swiper#2.0.8
npm ERR! node_modules/react-native-deck-swiper
npm ERR! react-native-deck-swiper#"^2.0.8" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native#0.49.5
npm ERR! node_modules/react-native
npm ERR! peer react-native#"^0.49.1" from react-native-deck-swiper#2.0.8
npm ERR! node_modules/react-native-deck-swiper
npm ERR! react-native-deck-swiper#"^2.0.8" 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\Leago\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\Leago\AppData\Local\npm-cache_logs\2022-08-31T23_17_27_722Z-debug-0.log
I had the same issue as you, I found out it's more related to the command npm, apparently it works with yarn.
You can check these two links in which the problem is treated, but I don't think forcing the installation with npm install --force is a good idea:
React-native-deck-swiper unable to install
https://github.com/alexbrillant/react-native-deck-swiper/issues/337

React native maps not getting added to project

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

#react-native-community/datetimepicker install throwing error

I tried to install datetime picker for my react-native (expo) project but, when i try to install it;
expo install #react-native-community/picker
It throws error;
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.13.1
npm ERR! node_modules/react
npm ERR! react#"16.13.1" from the root project
npm ERR! peer react#">=16.8.3" from #react-native-community/datetimepicker#3.2.0
npm ERR! node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"3.2.0" from the root project
npm ERR! 1 more (react-native)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native-windows#0.64.12
npm ERR! node_modules/react-native-windows
npm ERR! peer react-native-windows#">=0.62" from #react-native-community/datetimepicker#3.2.0
npm ERR! node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"3.2.0" 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\irfan\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\irfan\AppData\Local\npm-cache\_logs\2021-06-30T13_38_37_968Z-debug.log
As per this error (if i got it right), this requires a different version of react (17.0.1) which when installed solves the problem but this version of the react is not supported by expo.
Please provide a solution which will be compatible with expo.
After searching for a whole day, i thought to post it here. But just after posting, i got an answer in my mind.
Why not to clone it directly from the github instead of installing it with expo or npm.
Did the same thing and now working fine.
This issue was also raised on github but it had no solutions.

Expo and Native Base unable to resolve dependency tree

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.

React-navigation- dependencies (Error while install NPM navigation dependencies package installation)

when I install this package
1 . npm install #react-native-community/masked-view .
it shows error like this
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Sample_pro#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!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0" from #react-native-community/masked-view#0.1.10
npm ERR! node_modules/#react-native-community/masked-view
npm ERR! #react-native-community/masked-view#"*" 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\HP\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\HP\AppData\Local\npm-cache_logs\2021-04-21T03_52_51_024Z-debug.log
-----How should I solve this problem-----
Ther error message is telling you that
your proj is using react # 17.0.1 version while #react-native-community/masked-view 0.1.10 has a dependency of react # 16.
To solve it, you can choose one of the followings:
upgrade #react-native-community/masked-view to the latest package which is accepting react#16 and react#17
downgrade your root project's react version to 16
please remove package-lock.json file and try to install again hope it will work.