Home > Back-end >  While resolving: [email protected] (old React project)
While resolving: [email protected] (old React project)

Time:02-01

I have a React app which I haven't worked on in awhile. After cloning I run npm i and get the following errors:

> 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@"^17.0.1"
> from the root project npm ERR!   peer react@">=16.3.0" from
> @emotion/[email protected] npm ERR!   node_modules/@emotion/core npm ERR!   
> @emotion/core@"^10.0.15" from [email protected] npm ERR!    
> node_modules/react-spinners npm ERR!       react-spinners@"^0.9.0"
> from the root project npm ERR!   8 more (@testing-library/react,
> mini-create-react-context, ...) npm ERR!  npm ERR! Could not resolve
> dependency: npm ERR! peer react@"^16.0.0" from [email protected]
> npm ERR! node_modules/react-spinners npm ERR!  
> react-spinners@"^0.9.0" from the root project npm ERR!  npm ERR!
> Conflicting peer dependency: [email protected] npm ERR! node_modules/react
> npm ERR!   peer react@"^16.0.0" from [email protected] npm ERR!  
> node_modules/react-spinners npm ERR!     react-spinners@"^0.9.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
> /home/arch/.npm/eresolve-report.txt for a full report.
> 
> npm ERR! A complete log of this run can be found in: npm ERR!    
> /home/arch/.npm/_logs/2023-02-01T09_41_23_592Z-debug-0.log

I'm wondering if there's a way I can fix this and what the best practice would be to update my dependencies with little headache.

CodePudding user response:

react-spinners version 0.9.0 only support react 16.

You need to update react-spinners to version 0.13.8. version 0.13.8 Is today newest version

Run npm i [email protected].

If you don't want to update it you can run npm i --legacy-peer-deps.

CodePudding user response:

Use npm i --legacy-peer-deps when you install node_modules

  • Related