Difficulties install React Native Elements - react-native

Attempting to add React Native Elements to my project, but it's not going through.
I used react-native init <ProjectName> to initialize my project, and I attempting to follow up with npm install #rneui/themed #rneui/base, as per the instructions here, but I am given the following sequence of errors:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: react-native-safe-area-context#4.3.1
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context#"^4.3.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-safe-area-context#"^3.1.9" from #rneui/base#4.0.0-rc.4
npm ERR! node_modules/#rneui/base
npm ERR! #rneui/base#"^4.0.0-rc.4" 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\Kookeh\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\Kookeh\AppData\Local\npm-cache\_logs\2022-06-13T20_21_44_602Z-debug-0.log
I am unsure what am I doing wrong, or what steps I can take to remedy the issue. I've been trying to get my project up and running for a few days now, but I keep running into issues like this that have few solutions when I look them up.

That's because NPM installed the latest version of the package and some libraries uses an older version.
You should edit the package.json file of your project.
Go to the file on your react native project and find the line that has the definition of react-native -safe-area-context.
The line should look like this:
"react-native-safe-area-context": "^4.3.1"
And replace the version like this:
"react-native-safe-area-context": "3.1.9"
That worked for me.

Related

Fix the upstream dependency conflict, React Native Expo

I have a React Native Expo application, and I am trying to install expo-splash-screen with running npx expo install expo-splash-screen
As a result I get the following error message:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-navigation-drawer#2.7.2
npm ERR! Found: react-native-gesture-handler#2.5.0
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler#">= 1.0.0" from #react-navigation/drawer#6.5.0
npm ERR! node_modules/#react-navigation/drawer
npm ERR! #react-navigation/drawer#"^6.5.0" from the root project
npm ERR! peer react-native-gesture-handler#">= 1.5.0" from react-navigation-stack#2.10.4
npm ERR! node_modules/react-navigation-stack
npm ERR! react-navigation-stack#"^2.10.4" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-gesture-handler#"^1.0.12" from react-navigation-drawer#2.7.2
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^2.7.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-gesture-handler#1.10.3
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler#"^1.0.12" from react-navigation-drawer#2.7.2
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^2.7.2" 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.
While running npm -v react-native-gessture-handler it says: 8.15.0.
I have also tried using npm i react-native-splash-screen --force but it is not good for an expo application, and I am pretty sure that installing react-navigation-drawer with --force resulted the problem.
I am not really experienced with package managing so I do not really get the point of the error message. How can I install expo-splash-screen, and can somebody explain the error message?
It looks you have libraries that use different versions of react-native-gesture-handler. react-navigation-drawer is using and older react-native-gesture-handler version and this package is deprecated so you cannot update it to use a higher version of react-native-gesture-handler.
The best solution in my opinion is to change the package react-navigation-drawer to #react-navigation/drawer as it says in the documentation of the package.
The other alternative but at your own risk is to specify in the package.json a resolution with the react-native-gesture-handler you need in expo-splash-screen and every library that have as peer dependecy react-native-gesture-handler will use this specific version.
"resolutions": {
"react-native-gesture-handler": "x.x.x"
}
Let me know if it helps

NPM peer dependency conflict caused through (correct) peerDependency

I created several NPM libraries myself.
One of them is called datahive-ngx-graph and has version number 0.0.11
Another one is called datahive-ngx-spo-layout and has a version number 0.0.7
The datahive-ngx-spo-layout needs the ngx-graph package and therefore has a peerDependency for it in the package.json:
"datahive-ngx-graph": "^0.0.9",
This means for me that the datahive-ngx-spo-layout can only be installed in projects that have at least version 0.0.9 but < 0.1.0 of this package installed.
My current project has the following entries:
"datahive-ngx-graph": "^0.0.11",
"datahive-ngx-spo-layout": "^0.0.7",
So the requirement should be fulfilled, right?
But when I do npm install, I still get the following error message:
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree npm ERR! npm ERR! While resolving: group-hive#1.0.0 npm ERR!
Found: datahive-ngx-graph#0.0.11 npm ERR!
node_modules/datahive-ngx-graph npm ERR!
datahive-ngx-graph#"^0.0.11" from the root project npm ERR! npm ERR!
Could not resolve dependency: npm ERR! peer
datahive-ngx-graph#"^0.0.9" from datahive-ngx-spo-layout#0.0.7 npm
ERR! node_modules/datahive-ngx-spo-layout npm ERR!
datahive-ngx-spo-layout#"^0.0.7" from the root project
This appears strange to me. Did I misunderstand something regarding the meaning of ^ or ~ in the NPM package names?
Where could be my problem?

Git - Cloning Vue.js project and run

I have cloned a project from a Git Repo into my Mac, It only has project files not the node modules.
In GIT : Readme.md says run npm install to setup the project.
When I run the npm install I get below error list, how do I get through it?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #vue/eslint-config-standard#6.1.0
npm ERR! Found: eslint-plugin-vue#8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue#"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue#"^7.0.0" from #vue/eslint-config-standard#6.1.0
npm ERR! node_modules/#vue/eslint-config-standard
npm ERR! dev #vue/eslint-config-standard#"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-vue#7.20.0
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue#"^7.0.0" from #vue/eslint-config-standard#6.1.0
npm ERR! node_modules/#vue/eslint-config-standard
npm ERR! dev #vue/eslint-config-standard#"^6.1.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 /Users/dev/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dev/.npm/_logs/2022-06-23T23_17_06_125Z-debug-0.log
This bug seems current, to reproduce it :
vue create hello-world
Vue CLI v5.0.8
...
npm install
and if you do : rm -rf node_modules then npm install you get error :
npm ERR! While resolving: #vue/eslint-config-standard#6.1.0
And no solution till now
thank you
What I did to get rid of the problem was removing the:
"eslint-plugin-vue": "^8.0.3",
line in the package.json file.
from the "devDependencies" section.
Then I did an
npm install
to download all the dependencies. And after that I downloaded the eslint Vue plugin seperatly with the Vue CLI.
vue add eslint
I don't know if this is the solution to the problem. I just wanted to help.

#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.

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.