npm ERESOLVE error when installing Material UI - npm

Getting ERESOLVE error when trying to install #material-ui/core and gatsby-plugin-material-ui:
npm install #material-ui/core gatsby-plugin-material-ui
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-default#0.1.0
npm ERR! Found: gatsby#4.1.2
npm ERR! node_modules/gatsby
npm ERR! gatsby#"^4.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby#"^3.0.0" from gatsby-plugin-material-ui#4.0.3
npm ERR! node_modules/gatsby-plugin-material-ui
npm ERR! gatsby-plugin-material-ui#"*" 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!
How can I resolve this error?

Seems like your dependency tree is either broken or the packages you are trying to install have dependencies on their own that are also used by other peer dependencies but on different versions.
First, try removing all installed packages and lock files:
rm -rf node_modules && rm package-lock.json
You can then try re-installing them but with the --legacy-peer-deps flag:
npm install #material-ui/core gatsby-plugin-material-ui --legacy-peer-deps

Related

I am trying to install angular material i gave the command npm install #angular/material #angular/cdk, I am facing the below issue

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree npm ERR! npm ERR! While resolving: dex-web-ui#0.0.0 npm ERR!
Found: #angular/animations#8.2.14 npm ERR!
node_modules/#angular/animations npm ERR!
#angular/animations#"~8.2.14" from the root project npm ERR! npm ERR!
Could not resolve dependency: npm ERR! peer
#angular/animations#"^14.0.0 || ^15.0.0" from #angular/material#14.2.6
npm ERR! node_modules/#angular/material npm ERR!
#angular/material#"*" 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!
I tried to update using the command npm update #angular/material #angular/cdk and seeing this issue.
code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR!
While resolving: karma-jasmine-html-reporter#1.5.1 npm ERR! Found:
jasmine-core#3.4.0 npm ERR! node_modules/jasmine-core npm ERR! dev
jasmine-core#"~3.4.0" from the root project npm ERR!
jasmine-core#"^3.3" from karma-jasmine#2.0.1 npm ERR!
node_modules/karma-jasmine npm ERR! dev karma-jasmine#"~2.0.1"
from the root project npm ERR! peer karma-jasmine#">=1.1" from
karma-jasmine-html-reporter#1.5.1 npm ERR!
node_modules/karma-jasmine-html-reporter npm ERR! dev
karma-jasmine-html-reporter#"^1.4.0" from the root project npm ERR!
npm ERR! Could not resolve dependency: npm ERR! peer
jasmine-core#">=3.5" from karma-jasmine-html-reporter#1.5.1 npm ERR!
node_modules/karma-jasmine-html-reporter npm ERR! dev
karma-jasmine-html-reporter#"^1.4.0" from the root project
I also had this issue you can run the npm install --legacy-peer-deps this worked for me to upgrade the material version
you need remove one of the two packages that conflict , I had the same problem with the package animations , I had installed version 15.2 and 14.1 , I removed the 15 via the command ( npm unistall #angular/animations#15.1.2 ) :
npm unistall <package name>
in your case I think the conflict is caused by the package jasmine-core# 3.5 , 3.3 and 3.4 , uninstall 2 package and should go

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

ERESOLVE unable to resolve dependency tree while installing Font Awesome

I am workin on a react native project and I tried installing Font Awesome "npm i --save #fortawesome/react-native-fontawesome #fortawesome/fontawesome-svg-core react-native-svg"
using but I got
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: homesick#1.0.0
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"18.0.0" from react-native#0.69.4
npm ERR! node_modules/react-native
npm ERR! react-native#"0.69.4" from the root project
npm ERR! peer react-native#">= 0.67" from #fortawesome/react-native-fontawesome#0.3.0
npm ERR! node_modules/#fortawesome/react-native-fontawesome
npm ERR! #fortawesome/react-native-fontawesome#"*" 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/itaylador/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/itaylador/.npm/_logs/2022-08-15T22_50_28_934Z-debug-0.log
How can I solve this error?
I had the same issue recently. Tried a lot configurations but the only thing that worked for me was downgrade from react#18.2.0 to react#18.0.0 in the package.json
Some other guys here on stackoverflow gave the hint (if you have peer dependency conflicts) to open (on MacOS) /Users/YourUser/.npm folder and delete the folders _cacache, _logs, _npx
You can also try to delete node_modules folder and package-lock.json file at the end and re-install via "npm install"

Npm install is installing parttial packages and then throwing error

PS D:\Latest_Workspace\LLA-monorepo> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: lla#1.0.0
npm ERR! Found: #angular/core#12.2.13
npm ERR! node_modules/#angular/core
npm ERR! #angular/core#"12.2.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/core#"^11.0.0" from #ngrx/effects#11.0.0
npm ERR! #ngrx/effects#"11.0.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\ravishankar.c.PRODAPT\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\ravishankar.c.PRODAPT\AppData\Local\npm-cache_logs\2022-01-31T18_22_27_563Z-debug.log
Try using --force or --legacy-peer-deps flag. If that does not work try downgrading your npm version.
Check out here

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.