Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Troubleshooting installation error with Sanity in a React project folder.

20 replies
Last updated: Feb 23, 2021
I just tried installing sanity inside of my project folder (I failed to do that before) and now I'm getting a different error about something missing.
Feb 23, 2021, 12:38 PM
Hey Kieran! Let’s see if we can troubleshoot this. What command did you use to originally install Sanity?
Feb 23, 2021, 5:58 PM
Hello
user M
thanks for checking in on my problem. I used
npm install -g @sanity/cli
from inside my react project's folder
Feb 23, 2021, 6:01 PM
Next, I used
sanity login
for logging in followed by
sanity init
which is when the error showed up. I couldnt find any fixes yet so the whole process is on hold
Feb 23, 2021, 6:03 PM
During the various steps for of
sanity init
process when it starts
resolving dependencies
it throws that error
Feb 23, 2021, 6:05 PM
Hmm, this looks like someone who had a similar error. Try to
cd
into your project folder and run
npm install node_modules
and see if that helps.
Feb 23, 2021, 6:08 PM
Sure checking it out now, thanks
Feb 23, 2021, 6:09 PM
Doesn't seem to work sadly, Gives me another error
Feb 23, 2021, 6:13 PM
Just fyi, I ran
npm install
inside my project folder just now and tried
sanity init
its throwing the same error when resolving dependencies
Feb 23, 2021, 6:25 PM
I looks like you may have installed Sanity just as we were releasing the v2.4.0 version - sometimes the NPM registry is not fully up to date during the publishing process, which can lead to this (initial) error message.
I would try removing
node_modules
(
rm -rf node_modules
) and reinstalling dependencies (
npm install
).
Having said that, the latest error you're seeing is odd - maybe the official npm registry is having some issues? That module isn't one of "ours"...
Feb 23, 2021, 6:27 PM
Can you try doing the mentioned rm + npm install proceedure and see if that helps? The
sanity
command uses yarn internally instead of npm, so it might have slightly different behavior
Feb 23, 2021, 6:28 PM
I'm already working on it
user Z
hopefully it works this time lol. I've been stuck here all day unable to do anything with the project sighs
Feb 23, 2021, 6:30 PM
One of those days, eh? 😓
Feb 23, 2021, 6:30 PM
Yuppers 😞 It's my first ever react project and was excited to building it with sanity but here we are LOL
Feb 23, 2021, 6:31 PM
Sorry to hear that, let me know how the install goes :x
Feb 23, 2021, 6:33 PM
Ah crap! I'm now getting a whole new error with
npm install
now 🤦‍♀️
Feb 23, 2021, 6:36 PM
Uh. Never seen that before.The interwebs suggest
npm cache clean --force
and re-running
npm install
, but I'm on thin ice here 😅
Feb 23, 2021, 6:50 PM
I removed the
node-modules
again, restarted the terminal and installed npm and it worked without any errors, weird and I've run into that
cb error
before not sure how I resolved it. I'm now running
sanity init
Feb 23, 2021, 6:53 PM
As for the
cb() never called error
from above picture, they have a whole repo of issues from hundreds of folx and seems its unique to every single occurence and there's a whole lot of steps to reproduce the problem/error and then we gotta create a new issue on their repo and wait patiently for a fix, which could happen all over again lol
Feb 23, 2021, 6:56 PM
user Z
It actually went through this time and its working. Sorry took me a while to let ya know, I've got a slow connection here. I still have no idea why that even happened, apparently its something I deal with every time I either create a new react-app or something new related to npm.
It's working now though. Thanks for your help and
user M
, appreciate it
Feb 23, 2021, 7:11 PM
Sounds frustrating! I’m glad it worked out now though!
Feb 23, 2021, 7:15 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?