When I try to install the react-burger-menu thingy on react using the npm install react-burger --save, it gives out this error and I cannot continue my project:
npm ERR! While resolving: MYPROJECT
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#">=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.9.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.
npm ERR!
How can I successfully install the burger menu?
Thanks in advance.
Package You're trying to download in only available for react version lesser than or equal to 17. You can use this package by downgrading from React 18 to React 17 by,
npm install react#17.0.0 react-dom#17.0.0
Or alternatively :
You can use another package for react burger thing ;-). May be I can help for alternate package ?
Related
Im trying to install #tsamantanis/react-glassmorphism in my project.
npm install --save #tsamantanis/react-glassmorphism
and i see this
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: cpprojectmovie#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#"^17.0.1" from #tsamantanis/react-glassmorphism#1.1.2
npm ERR! node_modules/#tsamantanis/react-glassmorphism
npm ERR! #tsamantanis/react-glassmorphism#"*" 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\mintam\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\mintam\AppData\Local\npm-cache\_logs\2022-09-22T03_24_18_239Z-debug-0.log
please help me to find the solution. thank you in advance
The punchline is this:
npm ERR! peer react#"^17.0.1" from #tsamantanis/react-glassmorphism#1.1.2
Peer dependency means the package you're trying to install expects the "peer" (in this case react#"^17.0.1 package) to be in the same project.
This means the package you're trying to install react-glassmorphism's latest version 1.1.2 expects your React version to be at least v17.
The solution is either upgrading your project's React version to v17, or installing an older version of react-glassmorphism package.
Look at the version history of the package and find the version that supports earlier version of React and install it:
npm i --save react-glassmorphism#<version here>
C:\reactcamp\camp-project> npm install semantic-ui-react semantic-ui-css
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: camp-project#0.1.0
npm ERR! Found: react#18.1.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#"^16.8.0 || ^17.0.0" from semantic-ui-react#2.1.2
npm ERR! node_modules/semantic-ui-react
npm ERR! semantic-ui-react#"^2.1.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.
npm ERR!
npm ERR! See C:\Users\zekis\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\zekis\AppData\Local\npm-cache\_logs\2022-05-01T18_07_14_536Z-debug-0.log
TLDR:
semantic-ui-react#2.1.2 is incompatible with React 18. As a workaround, you can downgrade your application to React 17.
While resolving: camp-project#0.1.0
npm ERR! Found: react#18.1.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
Those first three lines indicate that npm identified React 18 as your project's dependency.
Could not resolve dependency
npm ERR! peer react#"^16.8.0 || ^17.0.0" from semantic-ui-react#2.1.2
npm ERR! node_modules/semantic-ui-react
npm ERR! semantic-ui-react#"^2.1.2" from the root project
These 3 lines list semantic-ui-react's peer dependency, meaning it expects your project to have either React 16.8 or React 17 as dependency.
Fix the upstream dependency conflict
There are two ways to address this conflict:
Downgrade your project to React 17 using npm install react#17
Override semantic-ui-react's using yarn's Selective Resolution feature. Inside your package.json:
"resolutions": {
"semantic-ui-react/react": "^18.0.0"
}
You can use this article it helped me solved the same problem when i wanted to install semantic-ui with react 18 it will probably help you with other frameworks that doesn't compatible with react 18
when I using this command to install sass-loader in my project:
npm install sass-loader#12.4.0
show error like this:
➜ crx-selection-translate git:(6.x-master) ✗ npm install sass-loader#12.4.0
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: webpack#1.15.0
npm ERR! node_modules/webpack
npm ERR! dev webpack#"^1.13.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^5.0.0" from sass-loader#12.4.0
npm ERR! node_modules/sass-loader
npm ERR! sass-loader#"12.4.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/xiaoqiangjiang/.npm/eresolve-report.txt for a full report.
why did this happen? what should I do to fix this problem? is it possible to auto resolve and fix the dependencies? I really did not know which version should I use, and I still did not know the dependencies matrix, is it possible to let the npm to find the most suitable dependencies and auto install and fix?
I found a solution on dev.to
This worked for me
npm install -D sass-loader#^10 sass
In React Native application to make a navigation need to install #react-navigation/stack using npm install #react-navigation/stack and I have tried it and failed each and every times.
NPM version: 7.19.1
Node version: v15.14.0
Expo version: 4.8.1
After running npm install #react-navigation/stack this command I have faced the below error is given,
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined#undefined
npm ERR! Found: #react-navigation/native#3.8.4
npm ERR! node_modules/#react-navigation/native
npm ERR! #react-navigation/native#"^3.8.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #react-navigation/native#"^6.0.0" from #react-navigation/stack#6.0.1
npm ERR! node_modules/#react-navigation/stack
npm ERR! #react-navigation/stack#"*" 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/imdadul/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/imdadul/.npm/_logs/2021-08-04T07_46_39_555Z-debug.log
Note: Please concern the attached file and who have knowledge about this will be helpful to help me. Advanced Thanks!
You have dependency conflict which means that the dependency is incorrect and potentially broken. You could try to run the command with --force, or --legacy-peer-deps and see if that helps.
npm install #react-navigation/stack --force
or
npm install #react-navigation/stack --legacy-peer-deps
Sometimes removing the node_modules and package-lock.json file and run the command npm install #react-navigation/stack or try npm cache clean --force can work.
as the title suggests I'm trying to install DateTimePicker and I get this 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.0.4
npm ERR! node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"3.0.4" 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.5
npm ERR! node_modules/react-native-windows
npm ERR! peer react-native-windows#">=0.62" from #react-native-community/datetimepicker#3.0.4
npm ERR! node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"3.0.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\robbi\AppData\Local\npm-cache\eresolve-report.txt for a full report.
How can I do?
Sorry for the stupid question but I'm still studying ..
If you are using expo download your dependency through
expo install #react-native-community/datetimepicker
If you have used yarn or npm for that some dependencies might have a conflict with each other (because of incompatibility issues) whereas through expo install it will install the respective version of the package according to your expo version