Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prismic CLI does not work under WSL2 #1337

Closed
lure23 opened this issue Apr 18, 2024 · 1 comment
Closed

Prismic CLI does not work under WSL2 #1337

lure23 opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lure23
Copy link

lure23 commented Apr 18, 2024

Just a reminder that the Prismic login feature doesn't work under WSL2.

I decided to give it a try, by installing a browser. Tested that xdg-open http://{some url} works.

Preparation

$ npm install -g prismic-cli
...

Any browser would likely do:

$ sudo apt install firefox
...

Steps

$ prismic login
Prismic: Press any key to open up the browser to login or q to exit:
Opening browser to https://prismic.io/dashboard/cli/login?port=5555
Prismic: Logging in... done
node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
          ^

Error: spawn EIO
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:761:9)
    at Object.open (/usr/lib/node_modules/prismic-cli/node_modules/cli-ux/lib/open.js:64:29)
    at /usr/lib/node_modules/prismic-cli/lib/utils/server.js:77:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -5,
  code: 'EIO',
  syscall: 'spawn'
}

Node.js v20.12.2

The error message doesn't really reveal much. Spawning fails, but why?

Expected

Since I am running Linux, and there is a browser, I can log in to my Prismic account, in order to do development.

Actual

The command fails.

Note: If you try the same with sudo, the error message is different - but weirder. It tries to spawn cmd.exe as if in Windows.

 syscall: 'spawn cmd.exe',
 path: 'cmd.exe',
 spawnargs: [
   '/c',
   'start',
   '""',
   '/b',
   'https://prismic.io/dashboard/cli/login?port=5555'
 ]

I would really like to give Prismic a go, but since it's not compatible with either WSL or a headless Linux sandbox, I might need to pass.

Versions

$ uname -a
Linux [...]5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux`
$ node --version
v20.12.2
$ npm --version
10.5.2
@lure23 lure23 added the bug Something isn't working label Apr 18, 2024
@lure23
Copy link
Author

lure23 commented Apr 18, 2024

Wrong repo, reposted as prismicio/prismic-cli#185

@lure23 lure23 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant