nuxt / cli

⚡️ Nuxt Generation CLI Experience.
https://github.com/nuxt/cli/discussions/3
MIT License
239 stars 51 forks source link

Post installation script fails when using bun for windows #384

Open lucashcl opened 3 months ago

lucashcl commented 3 months ago

Environment

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
danielroe commented 3 months ago

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

lucashcl commented 3 months ago

The issue is fixed in bun 1.1.1

timoschwarzer commented 3 months ago

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

VVMaestro commented 2 months ago

This issue also appears when using npx, not only bunx

UPD: persists on MacOS and Windows

Troum commented 2 months ago

Yes, I got this too

linuxmobile commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

also observe this error on windows

callumbirks commented 1 month ago

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

angelacaldas commented 2 weeks ago

Having the same issue here when using bun. Disabling @nuxt/telemetry did not work as well. It was only possible to init a new nuxt project with npx and yarn.