Home > other >  Can't resolve the dependency tree when installing react-typed package
Can't resolve the dependency tree when installing react-typed package

Time:12-15

I tried to go to the @testing-library/react folder in node modules and change all the react versions to the same as the current one, which is 18.2.0, although knowing that the react versions are different. I'm aware that there are a few more folders with incompatible tree dependencies, but I think it has to do with the react-typed package.

 npm ERR! code ERESOLVE

 npm ERR! ERESOLVE could not resolve

 npm ERR! 

 npm ERR! While resolving: [email protected]

 npm ERR! Found: [email protected]

 npm ERR! node_modules/react

 npm ERR!   react@"^18.2.0" from the root project

 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!   3 more (react-dom, react-icons, react-scripts)

 npm ERR! 

 npm ERR! Could not resolve dependency:

npm ERR! peer react@"^16.3.0" from [email protected]

 npm ERR! node_modules/react-typed

 npm ERR!   react-typed@"^1.2.0" from the root project

 npm ERR! 

 npm ERR! Conflicting peer dependency: [email protected]

 npm ERR! node_modules/react

 npm ERR!   peer react@"^16.3.0" from [email protected]

 npm ERR!   node_modules/react-typed

 npm ERR!     react-typed@"^1.2.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 /vercel/.npm/eresolve-report.txt for a full report.
 
 npm ERR! A complete log of this run can be found in:

 npm ERR!     /vercel/.npm/_logs/2022-12-13T14_24_46_461Z-debug-0.log
 Error: Command "npm install" exited with 1

changing the dependency-peers inside the moduls when installed the react-typed I use

--legacy-peer-deps

as well and still gives me those errors now when I try tyo deploy it. All this time it didn't give me this error while doing the project...

CodePudding user response:

This error comes from version 7.x of npm.

Please try again with the --legacy-peer-deps option.

$ npm install --save react-typed --legacy-peer-deps

OR try to downgrade npm v6:

npm install -g npm@6
  • Related