ui
ui copied to clipboard
Error with installing packages trough the CLI with Bun
I noticed a strange problem when using the CLI to add components or to initialize a project. It fails to install the new dependencies and gives an error that looks like this:
Command failed with exit code 1: npm install [DEPENDENCY NAME]
npm ERR! fh.read is not a function. (In 'fh.read(buf, 0, 2048, 0)', 'fh.read' is undefined)
Or:
Invalid stdio option "undefined"
Commands with this issue:
bunx --bun shadcn-ui@latest init
bunx --bun shadcn-ui@latest add [ANY COMPONENT THAT ADDS NEW DEPENDENCIES]
It adds the component files normally, so it's not completely unusable, but you just have to install the new dependencies manually.
similar issue when using bun for the cli
❯ bunx --bun shadcn-ui@latest add navigation-menu
⠋ Installing components...Command failed: bun add @radix-ui/react-navigation-menu
Invalid stdio option "undefined"
it creates the component, just fails adding packages
I'm actually getting this error when I try to init shadcn:
$ bunx --bun shadcn-ui@latest init
✔ Which style would you like to use? › Default
✔ Which color would you like to use as base color? › Zinc
✔ Would you like to use CSS variables for colors? … no / yes
✔ Writing components.json...
✔ Initializing project...
⠋ Installing dependencies...Command failed: bun add tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
Invalid stdio option "undefined"
similar issue when using bun for the cli
❯ bunx --bun shadcn-ui@latest add navigation-menu ⠋ Installing components...Command failed: bun add @radix-ui/react-navigation-menu Invalid stdio option "undefined"
it creates the component, just fails adding packages
Yes, I'm getting that as well
Strangely, the problem does not occur in Github Codespaces
I'm running into an issue as well but I don't quite have the same error, mine seems to be related to worker_threads implementation, there is an existing similar issue in the bun repo https://github.com/oven-sh/bun/issues/4165
Same issue here with bun... at the CSS variables step.
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
This issue hasn't been fix. I don't see the point of closing it.
I also have this issue, but maybe it is because bun has to support it, is there no issue at bun's side?
I'm working on other things right now, but have you guys done a bun upgrade
recently?
I was having the same issue but after bun upgrade
from v1.0.22
to v1.0.30
everything seems to be good now!
I'm actually getting this error when I try to init shadcn:
$ bunx --bun shadcn-ui@latest init ✔ Which style would you like to use? › Default ✔ Which color would you like to use as base color? › Zinc ✔ Would you like to use CSS variables for colors? … no / yes ✔ Writing components.json... ✔ Initializing project... ⠋ Installing dependencies...Command failed: bun add tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react Invalid stdio option "undefined"
Hello sir, I'm facing the same problem, Can you help me fix it?
I'm actually getting this error when I try to init shadcn:
$ bunx --bun shadcn-ui@latest init ✔ Which style would you like to use? › Default ✔ Which color would you like to use as base color? › Zinc ✔ Would you like to use CSS variables for colors? … no / yes ✔ Writing components.json... ✔ Initializing project... ⠋ Installing dependencies...Command failed: bun add tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react Invalid stdio option "undefined"
Hello sir, I'm facing the same problem, Can you help me fix it?
Upgrade Bun with bun upgrade
to fix that issue