teodosii / react-notifications-component

Delightful and highly customisable React Component to notify your users
https://teodosii.github.io/react-notifications-component/
MIT License
1.27k stars 73 forks source link

I can't install the library on my React Js Project #120

Closed VictorPotes closed 3 years ago

VictorPotes commented 3 years ago

Hello!

I am trying to install the library to my project with npm install react-notifications-component, but always appears the following Error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-proyect@0.1.0 
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"^16.13.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.1" from react-notifications-component@3.1.0
npm ERR! node_modules/react-notifications-component
npm ERR!   react-notifications-component@"^3.0.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.

Can someone help me please? I don't know exactly what to do to add it, it looks like an amazing feature to my project and I would like to have it.

Thank you.

mecharmor commented 3 years ago

What is your react version? if i'm reading this right, you must have a version of react newer than 17.0.1

mecharmor commented 3 years ago

oh actually I think that is exactly the problem. it looks like your react version is 16.14.0 but you need at least 17.0.1. I think there is a very slight chance this lib could work if you isntalled with npm install react-notifications-component --legacy-peer-deps but I would assume the behavior is unpredictable and will probably just crash. I think if you just upgrade your React version it should install successfully

mecharmor commented 3 years ago

@VictorPotes bump

teodosii commented 3 years ago

Either update your React version or stick to a previous react-notifications-component which had react 16 as dependency.