workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: ERROR SystemError [ERR_TTY_INIT_FAILED] While installing using Git Bash

Open Muhammad-Sarfaraz opened this issue 1 year ago • 2 comments

Which Cloudflare product(s) does this pertain to?

C3 (npm create cloudflare), Wrangler

What version(s) of the tool(s) are you using?

2.27.3[C3]

What version of Node are you using?

v18.18.1

What operating system and version are you using?

Windows 10

Describe the Bug

Description

While installing the latest Cloudflare setup using the following command in Git Bash:

npm create cloudflare@latest

I encountered the following error:

ERROR  SystemError [ERR_TTY_INIT_FAILED]: TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)

image

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

Muhammad-Sarfaraz avatar Sep 20 '24 12:09 Muhammad-Sarfaraz

@Muhammad-Sarfaraz I've tried to test this locally, but am unable to reproduce. I'm not on Windows, but we do have E2E tests for Windows for this workflow.

Can you just check again to see if this is still an issue for you?

andyjessop avatar Oct 07 '24 13:10 andyjessop

@Muhammad-Sarfaraz I've tried to test this locally, but am unable to reproduce. I'm not on Windows, but we do have E2E tests for Windows for this workflow.

Can you just check again to see if this is still an issue for you?

Still facing issues with Git Bash on my OS, could a warning be added for this? Use Powershell instead git bash?

Muhammad-Sarfaraz avatar Oct 09 '24 10:10 Muhammad-Sarfaraz

After some internal discussion, it looks like we do something similar, where instead of warning, we just move to raw mode instead: https://github.com/cloudflare/workers-sdk/blob/3ee1353d317c0e137a14f3091b32eecd575cc7a4/packages/wrangler/src/utils/onKeyPress.ts#L22-L25

The advantage of this is that we could generalise it by creating a isTTYSupported() function.

andyjessop avatar Nov 04 '24 15:11 andyjessop