Dependency conflict. Unable to resolve dependency tree - reactjs

I'm creating React project and use Mantine library. When I try to install #modulz/radix-icons dependency I get error messages that there is a dependency conflict . How can I solve this problem?
Error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-mantine-app#0.1.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#"^16.x || ^17.x" from #modulz/radix-icons#4.0.0
npm ERR! node_modules/#modulz/radix-icons
npm ERR! #modulz/radix-icons#"*" 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\igorg\AppData\Local\npm-cache\eresolve-report.txt for a full report.

use npm install --legacy-peer-deps

Related

npm i react-google-login is not able to install

I am trying to install the package "react-google-login" in my project for user authentication.
Here is the error code :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#0.1.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#"^16 || ^17" from react-google-login#5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login#"*" 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\prajw\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\prajw\AppData\Local\npm-cache\_logs\2022-08-30T16_30_08_237Z-debug-0.log
I think there is some error with version of react
I think this may fix your issues. try this
npm i react-google-login --legacy-peer-deps
What does this do? it ignores old dependencies for this package.
You can learn more about legacy peer deps here

Problem while installing MUI, and importing MUI components

home#Avinashs-MacBook-Pro archit-website % npm install #material-ui/core
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: archit-website#0.1.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#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"*" 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/home/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/home/.npm/_logs/2022-07-19T00_13_51_943Z-debug-0.log
I was trying to install material UI through my terminal, but it doesn't really install showing up some error. I am unsure of how I could solve this error. Kindly Suggest.

Npm is not getting installed

I am trying to setup this project. I m trying to do npm i, but it is not working. I have tried other commands as well; for say:
npm i --ignore-platform-dependencies
npm i --force
npm i --legacy-peer-deps
But it still shows;
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: hello-next#1.0.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.0" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react#">=0.14.0 <17.0.0" from react-burger-menu#2.9.2
npm ERR! node_modules/react-burger-menu
npm ERR! react-burger-menu#"^2.7.1" from the root project
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! See C:\Users\nas\AppData\Local\npm-cache\eresolve-report.txt for a full report.
I have changed the version and have tried to resolve dependencies conflict, but again some other dependency conflict arise.
What's the method of dealing with us project? How do I get it installed?

npm i react-push-notification npm ERR

C:\Users\USER\Desktop\Table-of-the-day-v-2\app>npm i react-push-notification
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: app#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0" from react-push-notification#1.3.0
npm ERR! node_modules/react-push-notification
npm ERR! react-push-notification#"*" 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\USER\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\USER\AppData\Local\npm-cache_logs\2021-10-08T15_15_54_627Z-debug.log
it's because the package has react v16.8.0 as a dependency and you have installed react v17.0.2 you can use npm i react-push-notification --force and it will install it.

NPM ERR when installing particle.js in React

I am getting below error when installing particle.js in my React App:
code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: app-test#0.1.0
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.0" from react-particles-js#3.4.1
npm ERR! node_modules/react-particles-js
npm ERR! react-particles-js#"*" 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\gydee\AppData\Local\npm-cache\eresolve-report.txt for a full report.
it is a problem coming from version 7 of npm use:
npm install --legacy-peer-deps
fixed it for me
npm install react-particles-js --force

Resources