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

Post installation script fails when using bun for windows #384

Open
lucashcl opened this issue Apr 2, 2024 · 9 comments
Open

Post installation script fails when using bun for windows #384

lucashcl opened this issue Apr 2, 2024 · 9 comments

Comments

@lucashcl
Copy link

lucashcl commented Apr 2, 2024

Environment

  • Operating System: Windows_NT
  • Node Version: v21.7.1
  • Nuxt Version: -
  • CLI Version: 3.11.1
  • Nitro Version: -
  • Package Manager: unknown
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

When i try to create a new nuxt project with bun for windows, the nuxt post install script throws an error. More specifically "TTY initialization faild"

Describe the bug

When i try to create a new nuxt project with bun for windows, the nuxt post install script throws an error. More specifically "TTY initialization failed"

Additional context

No response

Logs

ERROR  TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)                           17:34:17

  at new WriteStream (node:tty:93:11)
  at sD.prompt (project_folder/node_modules/consola/dist/chunks/prompt.mjs:141:676)
  at confirm (project_folder/node_modules/consola/dist/chunks/prompt.mjs:251:6)
  at Module.prompt (project_folder/node_modules/consola/dist/chunks/prompt.mjs:404:18)
  at project_folder/node_modules/consola/dist/shared/consola.36c0034f.mjs:617:71
  at async ensureUserconsent (project_folder/node_modules/@nuxt/telemetry/dist/shared/telemetry.023ac76b.mjs:26:20)
  at async setup (project_folder/node_modules/@nuxt/telemetry/dist/module.mjs:363:74)
  at async normalizedModule (project_folder/node_modules/@nuxt/kit/dist/index.mjs:2112:17)
  at async installModule (project_folder/node_modules/@nuxt/kit/dist/index.mjs:2415:95)
  at async initNuxt (project_folder/node_modules/nuxt/dist/index.mjs:4171:7)
  at async loadNuxt (project_folder/node_modules/nuxt/dist/index.mjs:4269:5)
  at async loadNuxt (project_folder/node_modules/@nuxt/kit/dist/index.mjs:2570:19)
  at async Object.run (project_folder/node_modules/nuxi/dist/chunks/prepare.mjs:53:18)
  at async runCommand$1 (project_folder/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
  at async runCommand$1 (project_folder/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
  at async runMain$1 (project_folder/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1777:7)



 ERROR  TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)                           17:34:17

error: postinstall script from "nuxt-app" exited with 1

 ERROR  Error: Command failed with exit code 1: bun install
Copy link
Member

This seems like a bug in Bun. Have you raised it there?

@danielroe danielroe transferred this issue from nuxt/nuxt Apr 3, 2024
@lucashcl
Copy link
Author

lucashcl commented Apr 5, 2024

The issue is fixed in bun 1.1.1

@timoschwarzer
Copy link

Doesn't seem to be fixed in bun 1.1.1, getting the same error in 1.1.3

@VVMaestro
Copy link

VVMaestro commented Apr 11, 2024

This issue also appears when using npx, not only bunx

UPD: persists on MacOS and Windows

@Troum
Copy link

Troum commented Apr 12, 2024

Yes, I got this too

@linuxmobile
Copy link

linuxmobile commented Apr 16, 2024

the error seems to come from the 'nuxt telemetry' prompt. But I still can't figure it out.

EDIT: solved with bunx @nuxt/telemetry disable -g

@guille1988
Copy link

at new WriteStream (node:tty:93:11)
at sD.prompt (node_modules/consola/dist/chunks/prompt.mjs:141:676)
at confirm (node_modules/consola/dist/chunks/prompt.mjs:251:6)
at Module.prompt (node_modules/consola/dist/chunks/prompt.mjs:404:18)
at node_modules/consola/dist/shared/consola.36c0034f.mjs:617:71
at async ensureUserconsent (node_modules/@nuxt/telemetry/dist/shared/telemetry.023ac76b.mjs:26:20)
at async setup (node_modules/@nuxt/telemetry/dist/module.mjs:363:74)
at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2112:17)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2415:95)
at async initNuxt (node_modules/nuxt/dist/index.mjs:4233:7)
at async loadNuxt (node_modules/nuxt/dist/index.mjs:4331:5)
at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)
at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:53:18)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1777:7)

me too

@ibqn
Copy link

ibqn commented May 9, 2024

also observe this error on windows

@callumbirks
Copy link

Also observing this in WSL.
I fixed it with by doing NUXT_TELEMETRY_DISABLED=1 bunx nuxi@latest init <project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants