🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Troubleshooting installation of @sanity/client dependency in Next.js

2 replies
Last updated: May 29, 2023
I’m running Next.js and I’ve installed all dependencies except @sanity/client. When I do install it, I get the warnings listed below. I tried running --legacy-peer-deps and using --force, but that doesn’t solve my conflicts. Do I have to install the other dependencies one by one after @sanity/client to see which one conflicts? Not sure how to proceed.
Warnings from terminal:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: stripe-ecommerce-app@0.1.0
npm WARN Found: @sanity/client@5.4.2
npm WARN node_modules/@sanity/client
npm WARN peer @sanity/client@“^5.0.0” from next-sanity-image@6.0.0
npm WARN node_modules/next-sanity-image
npm WARN next-sanity-image@“^6.0.0" from the root project
npm WARN 1 more (the root project)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @sanity/client@“^5.0.0” from next-sanity-image@6.0.0
npm WARN node_modules/next-sanity-image
npm WARN next-sanity-image@“^6.0.0" from the root project
May 29, 2023, 9:19 PM
They are just warnings, it looks like next-sanity-image is wanting
@sanity/client@^5.0.0
as a peer dependency but the latest version of the current is 6.1.2 which wouldn’t satisfy that requirement. The solution would be to have next-sanity-image to update their peer dependency
May 29, 2023, 10:01 PM
As James mentioned, as long as you’re not getting any errors, these are only warnings about peer dependencies and you should still be able to run everything.
May 29, 2023, 10:26 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?