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

Troubleshooting version mismatch between Sanity Studio and CLI

26 replies
Last updated: May 30, 2023
Hello all, I have one question. I made updates to the schema and tried to deploy Graphql.I run
>sanity graphql deploy
and then got this error
Mar 9, 2023, 5:44 PM
What version of the CLI are you on?
Mar 9, 2023, 5:49 PM
I am using 3.6.0
Mar 9, 2023, 5:49 PM
What does your
sanity.cli
file look like?
Mar 9, 2023, 5:51 PM
Well, where can I find the file ?
Mar 9, 2023, 5:53 PM
Well, in the root of your directory.
Mar 9, 2023, 5:54 PM
There isn't sanity.cli file in my project root
Mar 9, 2023, 5:56 PM
Ok, then it would be helpful if you share what version of the Studio you’re on.
Mar 9, 2023, 5:56 PM
Studio version is 2.36.0
Mar 9, 2023, 6:00 PM
The issue is likely related to the fact that you’re using V3 of the CLI with V2 of the Studio.
Mar 9, 2023, 6:00 PM
I see...
Mar 9, 2023, 6:06 PM
How can I update sanity studio version ?
Mar 9, 2023, 6:08 PM
It’s a major upgrade with many breaking changes. You’ll want to follow this series in the docs
Mar 9, 2023, 6:10 PM
Ok thanks!
Mar 9, 2023, 6:15 PM
If you’re not ready to upgrade, it may be better to just downgrade your CLI version until you’re ready for it.
Mar 9, 2023, 6:16 PM
Okay
Mar 9, 2023, 6:16 PM
Btw, how can I install specific cli version ?
Mar 9, 2023, 6:24 PM
npm install -g @sanity/cli@2.3.5
Mar 9, 2023, 6:25 PM
This didn't work
Mar 9, 2023, 6:25 PM
I think you may need to uninstall then reinstall.
Mar 9, 2023, 6:25 PM
I mean when reinstall, how can I set version ?
Mar 9, 2023, 6:26 PM
were you able to get this resolved, having this issue currently.
May 30, 2023, 6:30 AM
user T
May 30, 2023, 6:31 AM
Hi
user A
Yes
May 30, 2023, 6:48 AM
It is due to the version mismatch
May 30, 2023, 6:48 AM
I had to install older version sanity npm library on my local
May 30, 2023, 6:49 AM
user T
thanks, yeah I had to migrate over to v3, it was not so bad. Followed this https://www.sanity.io/docs/example-migrating-the-blog-template-from-studio-v2-to-v3
May 30, 2023, 11:06 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?