Upstream dependency conflict, npm sanity/client

Viewed 51

I'm trying to make a nextjs/sanity project at the moment, and I think I may have installed sanity client twice, but not entirely sure.

This is the error I'm getting in the command terminal:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-sanity-image@3.2.1
npm ERR! Found: @sanity/client@3.3.6
npm ERR! node_modules/@sanity/client
npm ERR!   @sanity/client@"^3.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @sanity/client@"^2.11.0" from next-sanity-image@3.2.1
npm ERR! node_modules/next-sanity-image
npm ERR!   next-sanity-image@"^3.2.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @sanity/client@2.23.2
npm ERR! node_modules/@sanity/client
npm ERR!   peer @sanity/client@"^2.11.0" from next-sanity-image@3.2.1
npm ERR!   node_modules/next-sanity-image
npm ERR!     next-sanity-image@"^3.2.1" 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.

I have tried npm install --legacy-peer-deps but it isn't fixing this error. I am currently trying to do npm install --save @babel/preset-react, which is what triggered these error messages. What is it that I need to do?

0 Answers
Related