skip to Main Content

I was logging into my sanity account through terminal or console but it didn’t seem to work since it was aborting the process automatically!
Anyone here know how to fix this thing?

C:UsersRealtrickzOneDriveDesktopecommerceecommerce>sanity login
? Login type Google

Opening browser at https://api.sanity.io/v1/auth/login/google?type=listen&uuid=___________________&source=cli&label=________

- Waiting for browser login to complete... Press Ctrl + C to cancelnode:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn undefinedSystem32WindowsPowerShellv1.0powershell ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn undefined\System32\WindowsPowerShell\v1.0\powershell',
  path: 'undefined\System32\WindowsPowerShell\v1.0\powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBoAHQAdABwAHMAOgAvAC8AYQBwAGkALgBzAGEAbgBpAHQAeQAuAGkAbwAvAHYAMQAvAGEAdQB0AGgALwBsAG8AZwBpAG4ALwBnAG8AbwBnAGwAZQA/AHQAeQBwAGUAPQBsAGkAcwB0AGUAbgAmAHUAdQBpAGQAPQAwAGQAZQBiAGYAOABiADcAYQBjAGMAZgBlAGIAZgBmADIAZgAzADQAYwAzADkAMQA4AGQAMgBlADEAZQA2ADUAJgBzAG8AdQByAGMAZQA9AGMAbABpACYAbABhAGIAZQBsAD0ARABFAFMASwBUAE8AUAAtAEkAVAA1ADcATwBDAE4AKwAlADIARgArAHcAaQBuADMAMgAiAA=='
  ]
}

Node.js v18.14.0

C:UsersRealtrickzOneDriveDesktopecommerceecommerce>

2

Answers


  1. The only fix that worked for me was to download Git Bash and run Sanity login there. Once logged in, you can use VScode terminal or CMD and run Sanity create… in the project folder you want to use.

    Login or Signup to reply.
  2. You have to use the git bash terminal, if you use the powershell one it always will throw the same error

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search