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: [email protected] 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 [email protected] 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.
CodePudding user response:
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 [email protected] [email protected]
Or alternatively :
You can use another package for react burger thing ;-). May be I can help for alternate package ?
CodePudding user response:
Another error:
PS C:\Users\USER\Desktop\MYPROJECT> npm install react-burger --save npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @testing-library/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! peer react@">=16.8.0" from @emotion/[email protected] npm ERR! node_modules/@emotion/react npm ERR! peer @emotion/react@"^11" from @theme-ui/[email protected] npm ERR! node_modules/@theme-ui/css npm ERR! @theme-ui/css@"^0.15.1" from [email protected] npm ERR! node_modules/theme-ui npm ERR! theme-ui@"^0.15.1" from the root project npm ERR! 4 more (@theme-ui/color-modes, @theme-ui/components, ...) npm ERR! peer @emotion/react@"^11" from @theme-ui/[email protected] npm ERR! node_modules/theme-ui/node_modules/@theme-ui/color-modes npm ERR! @theme-ui/color-modes@"^0.15.1" from [email protected] npm ERR! node_modules/theme-ui npm ERR! theme-ui@"^0.15.1" from the root project npm ERR! 1 more (@theme-ui/theme-provider) npm ERR! 3 more (@theme-ui/components, @theme-ui/core, @theme-ui/theme-provider) npm ERR! peer react@">=16.8.0" from @emotion/[email protected] npm ERR! node_modules/@emotion/use-insertion-effect-with-fallbacks npm ERR! @emotion/use-insertion-effect-with-fallbacks@"^1.0.0" from @emotion/[email protected] npm ERR! node_modules/@emotion/react npm ERR! peer @emotion/react@"^11" from @theme-ui/[email protected] npm ERR! node_modules/@theme-ui/css npm ERR! @theme-ui/css@"^0.15.1" from [email protected] npm ERR! node_modules/theme-ui npm ERR! 4 more (@theme-ui/color-modes, @theme-ui/components, ...) npm ERR! 4 more (@theme-ui/color-modes, @theme-ui/components, ...) npm ERR! 13 more (@react-aria/ssr, @restart/hooks, @restart/ui, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^18.0.0" from @testing-library/[email protected] npm ERR! node_modules/@testing-library/react npm ERR! @testing-library/react@"^13.4.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^18.0.0" from @testing-library/[email protected] npm ERR! node_modules/@testing-library/react npm ERR! @testing-library/react@"^13.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 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-10-04T13_22_55_234Z-debug-0.log