I am trying to install the Sanity studio and I followed these steps:
npm install --global @sanity/cli
sanity install
sanity init
After the init step, I try to run the next step:
sanity start
but it says:
Run the command again within a Sanity project directory, where "@sanity/core"
is installed as a dependency.
at D.runCommand (F:/All Node and related projects/node_modules/@sanity/cli/b
in/sanity-cli.js:3254:1345)
at t.exports (F:/All Node and related projects/node_modules/@sanity/cli/bin/sanity-cli.js:1794:2419)
But when I try to cd into my sanity project directory, it is not even able to recognize sanity, it says:
'sanity' is not recognized as an internal or external command,
operable program or batch file.
Is my dependencies directory structure incorrect?
What conditions should be met before you can call sanity start?
THANKS!
I ran into a similar problem wen trying to initialize Sanity. I tried all the above which didn't work form me. As advised above I would run
npm install -g @sanity/cli
then:
sanity init
And I would get the following error:
sanity : The term 'sanity' is not recognized as the name of a cmdlet
The solution I found to this was running the following instead:
npx @sanity/cli init
npx @sanity/cli start
This worked for me like a charm!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With