👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Trouble updating Sanity version, seeking help and guidance.

21 replies
Last updated: Jan 24, 2024
I have been away for the last couple of months dealing with family stuff, and now I have come back feeling like I can't remember how to do anything work-related, HA! Anyway, I am trying to update our Sanity from 3.19.3 to 3.26.0 and I can not, for the life of me, remember what the command is to update it, and I can't find it anywhere. Doing
npm update sanity
does not update to 3.26.0. I feel so silly and like the answer is obvious and right in front of me, but my brain just can't see it. 🤦‍♀️ Can someone please put me out of my misery here?!
Jan 24, 2024, 6:32 PM
You may have
3.19.3
locked into your package.json. changing it to
^3.19.3
will allow the update
Jan 24, 2024, 6:43 PM
nope, it's
"sanity": "^3.19.3"
😞 I have been updating sanity studio for the last two years with a simple command (that used to be noted under the version number when you needed to update), and I can't believe I have completely wiped it from my memory.
Jan 24, 2024, 8:03 PM
Have you tried removing your node_modules and lock file?
Jan 24, 2024, 8:05 PM
I will give that a shot. Is the command just
npm update sanity
?
Jan 24, 2024, 8:05 PM
You can run npm outdated to see if its outdated as well.
Jan 24, 2024, 8:06 PM
No luck.
When I do
npm outdated
, this is what I get.
Jan 24, 2024, 8:55 PM
And my dependencies in my package.json look like this:
Jan 24, 2024, 8:56 PM
try:

npm view sanity version

Jan 24, 2024, 8:56 PM
If you deleted your modules folder and lock file you’d run
npm i
to get everything loaded up again.
Jan 24, 2024, 8:57 PM
when i ran npm view sanity version it said 3.26.0 .... whaaaat
Jan 24, 2024, 8:58 PM
Success?
Jan 24, 2024, 8:58 PM
but... my package.json still says 3.19, and when I spin up the dev server it says it's 3.19
Jan 24, 2024, 8:59 PM
You may need to delete your lock file and
node_modules
and then run
npm i
Jan 24, 2024, 9:00 PM
I deleted the node_modules and did npm install after that, but I didn't delete the lock file. So I will do it again and delete the lock file this time
Jan 24, 2024, 9:01 PM
Your pgk.json saying
^3.19.3
means load up the most current version up to
4
Jan 24, 2024, 9:01 PM
oh I got ya
Jan 24, 2024, 9:01 PM
So it’ll load 3.26 but it won’t say so in the pkg.
Jan 24, 2024, 9:01 PM
ok, I spun up the dev server and it says it is 3.26. Thank you for your help on that. I feel like I have to relearn everything, ha!
But I did see something odd that I want to ask you about while you're still here... why is it saying the latest version is 3.21.1?
Jan 24, 2024, 9:05 PM
when, in prod it looks like this (I haven't pushed my changes to prod yet)
Jan 24, 2024, 9:06 PM
Very good question. My best guess is caching .
Jan 24, 2024, 9:07 PM
ok, I won't worry about it then. :simple_smile:
Jan 24, 2024, 9:08 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?