npm ERR! ERESOLVE unable to resolve dependency tree ReactJS

Viewed 16

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

1 Answers

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>
Related