🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Error installing Sanity through npm on terminal - authentication issue

6 replies
Last updated: Apr 24, 2024
Hey its probably not the first time but I keep getting an error on CLI create npm -y create sanity@latest
https://www.sanity.io/answers/error-installing-sanity-through-npm-on-terminal--authentication-issue The
sanity
module is not installed in current projectProject-specific commands not available until you run
pnpm install
You're setting up a new project!
We'll make sure you have an account with
Sanity.io . Then we'llinstall an open-source JS content editor that connects to
the real-time hosted API on
Sanity.io . Hang on.
Press ctrl + C at any time to quit.

Prefer web interfaces to terminals?
You can also set up best practice Sanity projects with
your favorite frontends on
https://www.sanity.io/templates
We can't find any auth credentials in your Sanity config
- log in or create a new account

? Login type Google

Opening browser at
https://api.sanity.io/v1/auth/login/google?type=token&label=Zwei+%2F+Windows&origin=http%3A%2F%2Flocalhost%3A4321%2Fcallback
⠋ Waiting for browser login to complete... Press Ctrl + C to cancelError: spawn UNKNOWN
at ChildProcess.spawn (node
:internal/child_process:421:11) at Object.spawn (node
:child_process:761:9) at baseOpen (C:\Users\nadir\AppData\Local\npm-cache\_npx\67a0730928194b24\node_modules\@sanity\cli\lib\_chunks-cjs\cli.js
:7157:37) { errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
Unhandled rejection: Error: spawn UNKNOWN
at ChildProcess.spawn (node
:internal/child_process:421:11) at Object.spawn (node
:child_process:761:9) at baseOpen (C:\Users\nadir\AppData\Local\npm-cache\_npx\67a0730928194b24\node_modules\@sanity\cli\lib\_chunks-cjs\cli.js
:7157:37)

Not sure what to do
Apr 24, 2024, 3:52 PM
You need to install the sanity cli first :
npm install --global sanity@latest
Apr 24, 2024, 4:01 PM
Then in your project you do
sanity logout
, then
sanity login
to log back in and it should work
Apr 24, 2024, 4:02 PM
Heyu
Apr 24, 2024, 4:13 PM
Its not working =/
Apr 24, 2024, 4:13 PM
Same error
Apr 24, 2024, 4:13 PM
Got itHere is the way to solve this for others >>>

sanity login --no-open

and open the url from your internet browser

https://api.sanity.io/v1 **
Apr 24, 2024, 4:51 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?