Resolving an issue with integrating Sanity in a React project on a Windows system.

10 replies
Last updated: Jul 3, 2023
Hey, I tried integrating sanity in my react project when I ran
npm create sanity@latest
with the required templates I was getting a
create-sanity is not a recognizable command
. I'm using a Windows system, how could I resolve this?
Jul 1, 2023, 5:49 PM
Hi
user F
. Can you explain what you mean by “with the required templates,” please?
Jul 1, 2023, 5:59 PM
Something like this 'npm create sanity@latest -- --template get-started --project 3f9jbmt9 --dataset production --provider google'
Jul 1, 2023, 6:01 PM
Interesting. That should prompt you to install
create-sanity
. Can you please try this command?

npm init sanity@latest -- --template get-started --project 3f9jbmt9 --dataset production --provider google
Jul 1, 2023, 6:23 PM
Still getting the same error.
Jul 1, 2023, 7:05 PM
What if you run
npx create-sanity
?
Jul 1, 2023, 7:23 PM
This worked! Thank you. I'm using yarn though, will there be any conflicts?
Jul 1, 2023, 8:24 PM
Ah, your original post mentioned npm so that explains the errors.
In that case, going all the way back to the beginning I believe you’ll want to run
yarn create sanity
.
Jul 1, 2023, 9:16 PM
Well I tried this, it gave me command not found error.
Jul 1, 2023, 10:02 PM
Hey Jonathan,
I prefer to use yarn, too. I normally run the npx command that Geoff gave you, and once I can open the studio in my IDE, I'll install the packages with yarn.
Jul 3, 2023, 10:00 PM
Thanks. I'll try that out.
Jul 3, 2023, 10:05 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?

Categorized in