Troubleshooting installation error with Sanity in a React project folder.
20 replies
Last updated: Feb 23, 2021
G
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
G
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
G
Hello
user M
thanks for checking in on my problem. I used npm install -g @sanity/clifrom inside my react project's folder
Feb 23, 2021, 6:01 PM
G
Next, I used
sanity loginfor logging in followed by
sanity initwhich 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
G
During the various steps for of
sanity initprocess when it starts
resolving dependenciesit throws that error
Feb 23, 2021, 6:05 PM
G
Hmm, this looks like someone who had a similar error. Try to
cdinto your project folder and run
npm install node_modulesand see if that helps.
Feb 23, 2021, 6:08 PM
G
Sure checking it out now, thanks
Feb 23, 2021, 6:09 PM
G
Doesn't seem to work sadly, Gives me another error
Feb 23, 2021, 6:13 PM
G
Just fyi, I ran
npm installinside my project folder just now and tried
sanity initits throwing the same error when resolving dependencies
Feb 23, 2021, 6:25 PM
G
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
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"...
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
G
Can you try doing the mentioned rm + npm install proceedure and see if that helps? The
sanitycommand uses yarn internally instead of npm, so it might have slightly different behavior
Feb 23, 2021, 6:28 PM
G
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 sighsFeb 23, 2021, 6:30 PM
G
One of those days, eh? 😓
Feb 23, 2021, 6:30 PM
G
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
G
Sorry to hear that, let me know how the install goes :x
Feb 23, 2021, 6:33 PM
G
Ah crap! I'm now getting a whole new error with
npm installnow 🤦♀️
Feb 23, 2021, 6:36 PM
G
Uh. Never seen that before.The interwebs suggest
npm cache clean --forceand re-running
npm install, but I'm on thin ice here 😅
Feb 23, 2021, 6:50 PM
K
I removed the
node-modulesagain, restarted the terminal and installed npm and it worked without any errors, weird and I've run into that
cb errorbefore not sure how I resolved it. I'm now running
sanity init
Feb 23, 2021, 6:53 PM
G
As for the
cb() never called errorfrom 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
G
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 itFeb 23, 2021, 7:11 PM
G
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.