negomi/react-burger-menu

Issues installing react-burger-menu with React 18

Closed this issue · 10 comments

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

Also having this issue.

Same. Anyone find a solution?

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

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.

@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... :(

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"
}
},

And @negomi thank you for this package!

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

Thank you! ✨