negomi / react-burger-menu

:hamburger: An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
http://negomi.github.io/react-burger-menu/
MIT License
5.05k stars 586 forks source link

Issues installing react-burger-menu with React 18 #464

Closed ghost closed 2 years ago

ghost commented 2 years ago

Don't know if the newly released version of React is the cause, but I have issues installing react-burger-menu.

Screenshot 2022-04-02 at 18 04 52

winstonpurnomo commented 2 years ago

Also having this issue.

SpencerDedrick commented 2 years ago

Same. Anyone find a solution?

ghost commented 2 years ago

Haven't tried it again since I opened this issue. Will try again and share my thoughts.

hari20493 commented 2 years ago

I have found a workaround for this, Download the repo and edit the package.json file

 "peerDependencies": {
    "react": ">=0.14.0 <18.2.0",
    "react-dom": ">=0.14.0 <18.2.0"
  },

then run npm pack

this will return a .tgz file in the directory, copy this to your project directory and edit your projects package.json file

inside dependencies add "react-burger-menu": "file:/<your-directory>/react-burger-menu-3.0.6.tgz"

now run npm install in your project and it will work.

ghost commented 2 years ago

@hari20493 thanks for the workaround. I must've made a mistake along the way because it's not working for me (yet!). Unfortunately, the issue is still not fixed... :(

g11baldwin commented 2 years ago

With npm 8.3.x and later the recommended workaround is to use overrides in the package.json. I used this (right after the dependencies {} ). My early tests are working, but I didn't inspect in depth. See this stackoverflow for details https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions

"overrides": { "react-burger-menu": { "react": ">=0.14.0 <19.0.0", "react-dom": ">=0.14.0 <19.0.0" } },

g11baldwin commented 2 years ago

And @negomi thank you for this package!

negomi commented 2 years ago

Hi folks, I have removed the upper React version limit in peer dependencies. It sounds like this should fix the issue.

ghost commented 2 years ago

Thank you! ✨

g11baldwin commented 2 years ago

That's great. Thank you, gary

Gary Baldwin @.*** Skype: g22baldwin (843) 813-7191

On Mon, May 23, 2022 at 7:19 AM Imogen @.***> wrote:

Closed #464 https://github.com/negomi/react-burger-menu/issues/464 as completed.

— Reply to this email directly, view it on GitHub https://github.com/negomi/react-burger-menu/issues/464#event-6660182890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE367UVW7QGS6QMISKN5HDVLNSVVANCNFSM5SLBRU4Q . You are receiving this because you commented.Message ID: @.***>