cli icon indicating copy to clipboard operation
cli copied to clipboard

Post installation script fails when using bun for windows

Open lucashcl opened this issue 10 months ago • 10 comments

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

lucashcl avatar Apr 02 '24 20:04 lucashcl

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

danielroe avatar Apr 03 '24 13:04 danielroe

The issue is fixed in bun 1.1.1

lucashcl avatar Apr 05 '24 20:04 lucashcl

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

timoschwarzer avatar Apr 09 '24 16:04 timoschwarzer

This issue also appears when using npx, not only bunx

UPD: persists on MacOS and Windows

VVMaestro avatar Apr 11 '24 13:04 VVMaestro

Yes, I got this too

Troum avatar Apr 12 '24 13:04 Troum

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

linuxmobile avatar Apr 16 '24 16:04 linuxmobile

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

guille1988 avatar Apr 16 '24 23:04 guille1988

also observe this error on windows

ibqn avatar May 09 '24 15:05 ibqn

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

callumbirks avatar May 12 '24 11:05 callumbirks

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.

angelacaldas avatar Jun 20 '24 19:06 angelacaldas