ui: 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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15
This issue hasn’t been fix. I don’t see the point of closing it.
I’m working on other things right now, but have you guys done a
bun upgraderecently?I was having the same issue but after
bun upgradefromv1.0.22tov1.0.30everything seems to be good now!stop your running termianl or any development terminal and then install shadcn ui components. It will fix the error
Upgrade Bun with
bun upgradeto fix that issue