Trouble updating Sanity version, seeking help and guidance.
21 replies
Last updated: Jan 24, 2024
S
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 sanitydoes 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
R
You may have
3.19.3locked into your package.json. changing it to
^3.19.3will allow the update
Jan 24, 2024, 6:43 PM
S
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
R
Have you tried removing your node_modules and lock file?
Jan 24, 2024, 8:05 PM
S
I will give that a shot. Is the command just
npm update sanity?
Jan 24, 2024, 8:05 PM
R
You can run npm outdated to see if its outdated as well.
Jan 24, 2024, 8:06 PM
S
No luck.
When I do
When I do
npm outdated, this is what I get.
Jan 24, 2024, 8:55 PM
S
And my dependencies in my package.json look like this:
Jan 24, 2024, 8:56 PM
R
try:
npm view sanity version
Jan 24, 2024, 8:56 PM
R
If you deleted your modules folder and lock file you’d run
npm ito get everything loaded up again.
Jan 24, 2024, 8:57 PM
S
when i ran npm view sanity version it said 3.26.0 .... whaaaat
Jan 24, 2024, 8:58 PM
R
Success?
Jan 24, 2024, 8:58 PM
S
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
R
You may need to delete your lock file and
node_modulesand then run
npm i
Jan 24, 2024, 9:00 PM
S
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
R
Your pgk.json saying
^3.19.3means load up the most current version up to
4
Jan 24, 2024, 9:01 PM
S
oh I got ya
Jan 24, 2024, 9:01 PM
R
So it’ll load 3.26 but it won’t say so in the pkg.
Jan 24, 2024, 9:01 PM
S
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?
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
S
when, in prod it looks like this (I haven't pushed my changes to prod yet)
Jan 24, 2024, 9:06 PM
R
Very good question. My best guess is caching .
Jan 24, 2024, 9:07 PM
S
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.