I'm trying to install this package npm install --save react-redux-firebase for React and I'm getting this error “Could not resolve dependency: npm ERR! peer react#"^16.3.0 || ^17.0.0" from react-side-effect#2.1.1” I use 18.2 version of React
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: professional-resources#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.3.0 || ^17.0.0" from react-redux-firebase#3.11.0
npm ERR! node_modules/react-redux-firebase
npm ERR! react-redux-firebase#"*" 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 resoluti
on.
What can i do:
The problem is that this library does not support react 18 or if they support it they didn't add it as a peer deps: see
You have multiple solutions:
Downgrading to react 17
Asking library maintainers and help them to upgrade to react 18
Forcing versions with npm resolutions (Use it at your own risk as the library does not support react 18 inside their peerDeps)
try this instead:
npm install --legacy-peer-deps react-redux-firebase redux-firestore
Related
Why am I having the below error
PS C:\Users\USER\Desktop\Shareme\shareme_frontend> npm install #sanity/client #sanity/image-url react-google-login react-icons react-loader-spinner react-masonry-css react-router-dom uuid
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: shareme_frontend#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\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\2022-06-29T15_11_18_949Z-debug-0.log
react-google-login is not updated to the latest react v18.
Either wait for an update, downgrade react to v17, or use --force flag.
npm i react-google-login --force
Note that by using --force, there is no guarantee that this package will work with v18 of react
react-google-login#5.2.2 is not compatible with react 18 version as 5.2.2 is published year ago as per npm page.
It is still looking for react version of 17 / 16.
Below error block will tell you this:
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16 || ^17" from react-google-login#5.2.2
You can downgrade your react for this specific project via :
deleting node_modules
run npm cache clean
manually update your package.json to change version of react to 17
run npm install
I used react-notifications-component (npm) before and it was working fine. but recently I tried to install it with react 18 and I got this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: code-challenge-front#0.1.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.1" from react-notifications-component#3.4.1
npm ERR! node_modules/react-notifications-component
npm ERR! react-notifications-component#"*" 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! A complete log of this run can be found in:
is there any solution? or I have to use another package?
react-notifications-component#3.4.1 is using peer dependencies of react#"^17.0.1"
If you want to use react-notifications-component#3.4.1 then you have to use react#"^17.0.1" otherwise you can not use it with react#"^18.0.0" till react-notifications-component provides new version support with react 18.
Alternatively, you can use npm i --legacy-peer-deps to avoid this issue.
This is a bug that and there is no solution for it right now... maybe in future...
https://github.com/teodosii/react-notifications-component/issues/152
you can use another package(recommended)
don't downgrade your react version(not a good solution)
I'm trying to try out the latest version of NextJS(version 12) to give my project access to SSR ServerComponents & Http streaming.
MaterialUI works fine with Next 12.0.7 and React 17 (installed using npx create-next-app#latest)
When I do
npm install react#beta react-dom#beta
Then
npm install #mui/material #mui/styled-engine-sc styled-components --save
Gives
(base) marcfielding#MBP meta-ui % npm install #mui/material #mui/styled-engine-sc styled-components --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: meta-ui#undefined
npm ERR! Found: react#18.0.0-rc.0-next-f2a59df48-20211208
npm ERR! node_modules/react
npm ERR! react#"^18.0.0-beta-24dd07bd2-20211208" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.2" from #mui/material#5.2.3
npm ERR! node_modules/#mui/material
npm ERR! #mui/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!
npm ERR! See /Users/marcfielding/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/marcfielding/.npm/_logs/2021-12-09T16_48_20_688Z-debug.log
Is this just a wait for MUI to catch up? Or is there a release I can install I was following the instructions from here previously?
If you don't mind using yarn, here is a repo you can fork with the deps you want: https://github.com/MiniDeathStar/material-ui-next12-react-18
If you want to use npm, you can run:
npm install #mui/material #mui/styled-engine-sc styled-components --legacy-peer-deps
Mui shouldn't be broken by React#18. I've used them together just fine. Npm is a finicky package manager though, so I'll advocate for Yarn 3 whenever I get the chance.
C:\Users\JohnSam\Desktop\React\smartapp>npm install --save react-tilt
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: smartbrain2#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#"^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-tilt#0.1.4
npm ERR! node_modules/react-tilt
npm ERR! react-tilt#"*" 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\Sengk\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\Sengk\AppData\Local\npm-cache\_logs\2021-11-30T08_35_11_646Z-debug.log
The error says that the version of React you are using (17.0.2) is not compatible with react-tilt.
When looking at the package.json file of react-tilt, you'll see it requires a peerdependency of react#^15.0.0 || ^16.0.0-beta || ^16.0.0.
NPM enforces correct peerdependencies by default since npm v7. If you realy want to, you can ignore this check and run npm install --save --legacy-peer-deps react-tilt.
Note that this means there is no guarantee this package will completely work with React 17.
I am using React 18.1.0 and had the same issue with react-tilt.
To fix it I ran this command:
npm install --save --legacy-peer-deps react-tilt
So far it is working ok.
I have faced the same issue with My React app, By installing the package using the below command helped me in solving the issue.
npm install --save --legacy-peer-deps react-tilt
I'm also using react 18 and just came across this since i've been stuck on this error but npm install --save --legacy-peer-deps react-tilt seems to make it work just fine.
I am trying to setup material dashboard from
git clone https://github.com/creativetimofficial/material-dashboard-react.git.
Using node-16
I run npm install
I get
npm ERR! While resolving: material-dashboard-react#1.10.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#"^15.3.0 || ^16.0.0" from react-swipeable-views#0.13.9
npm ERR! node_modules/react-swipeable-views
npm ERR! react-swipeable-views#"0.13.9" 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 /home/simha/.npm/eresolve-report.txt for a full report.
How can I resolve this.
It looks like the root project installs react#17.0.2. But "react-swipeable-views" requires version 15 or 16 of react.
Edit: As a first option, you could try updating "react-swipeable-views" to its latest version. It may possibly support React 17.
The following command will update it.
npm install react-swipeable-views#latest
If this doesn't work...
Try reducing the numbers for react in the package.json to something in the 16.x.x range, then re-run
npm install
so it will satisfy the peer dependency.
https://docs.npmjs.com/about-semantic-versioning
If you're not familiar with NPM semantic versioning, use this calculator. Enter react -> "^16.0.0" to see that it does not include 17
https://semver.npmjs.com/