bun icon indicating copy to clipboard operation
bun copied to clipboard

Can't run shadcn CLI a second time

Open Sisableng opened this issue 1 year ago • 1 comments

What version of Bun is running?

1.1.4+fbe2fe0c3

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

the first time I installed bun on my laptop then I installed shadcn/ui for the first time on the nextjs project that I created, everything worked fine, but when I created a new Nextjs project and installed shadcn/ui I got an error

$ bunx shadcn-ui@latest init
error: could not determine executable to run for package shadcn-ui

at first I thought this problem was from the shadcn CLI, but I tried looking for a fix on google and found this issue #4583, I followed this comment to reset the cache on the bun then I tried it and the CLI can work again

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Sisableng avatar May 16 '24 11:05 Sisableng

bunx --bun shadcn-ui@latest init use this and re-try..

vgseven avatar May 19 '24 12:05 vgseven

same here

$ bunx --bun shadcn-ui@latest add alert-dialog
error: could not determine executable to run for package shadcn-ui

$ bunx --bun shadcn-ui@latest init
error: could not determine executable to run for package shadcn-ui

psnwd avatar Jun 02 '24 20:06 psnwd

me too

C:\...>bunx --bun shadcn-ui@latest add dialog
error: could not determine executable to run for package shadcn-ui

youesei avatar Jun 06 '24 20:06 youesei

so what the best solution?

Sisableng avatar Jun 08 '24 11:06 Sisableng

so what the best solution?

I'm currently using bun for my project, but I use pnpm specifically to install any shadcn UI components until the issue is fixed.

pnpm dlx shadcn-ui@latest add accordion

psnwd avatar Jun 08 '24 12:06 psnwd

I'm also facing the same problem. : (

viiccwen avatar Jun 13 '24 13:06 viiccwen

hello @Sisableng , you can use this to substitute command: bun add shadcn-ui@latest bun shadcn-ui init bun shadcn-ui add <component>

viiccwen avatar Jun 15 '24 00:06 viiccwen

hello @Sisableng , you can use this to substitute command: bun add shadcn-ui@latest bun shadcn-ui init bun shadcn-ui add <component>

did it work for you? I think I've tried it before but it was the same, maybe I'll try it again in my next project.

Sisableng avatar Jun 15 '24 03:06 Sisableng

What version of Bun is running?

1.1.4+fbe2fe0c3

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

the first time I installed bun on my laptop then I installed shadcn/ui for the first time on the nextjs project that I created, everything worked fine, but when I created a new Nextjs project and installed shadcn/ui I got an error

$ bunx shadcn-ui@latest init
error: could not determine executable to run for package shadcn-ui

at first I thought this problem was from the shadcn CLI, but I tried looking for a fix on google and found this issue #4583, I followed this comment to reset the cache on the bun then I tried it and the CLI can work again

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

have you run the command bunx --bun shadcn-ui@latest init initially ?

vgseven avatar Jun 15 '24 06:06 vgseven

hello @Sisableng , you can use this to substitute command: bun add shadcn-ui@latest bun shadcn-ui init bun shadcn-ui add <component>

did it work for you? I think I've tried it before but it was the same, maybe I'll try it again in my next project.

Haha, yes. It's work for me. Hope u can find the solution.

viiccwen avatar Jun 16 '24 04:06 viiccwen

Looks like some of the comments doesn't read the initial post. The OP points towards another thread where a solution is presented. Had the same issue and the following that was written worked for me.

You can try again deleting bun's cache: bun pm cache rm (you also have to delete node_modules and bun.lockb again) @lorenzorapetti

fjohanssondev avatar Jun 20 '24 20:06 fjohanssondev

Looks like some of the comments doesn't read the initial post. The OP points towards another thread where a solution is presented. Had the same issue and the following that was written worked for me.

You can try again deleting bun's cache: bun pm cache rm (you also have to delete node_modules and bun.lockb again) @lorenzorapetti

Thank you very much. This helped me out a lot

creative-tutorials avatar Jun 26 '24 22:06 creative-tutorials

These set of commands are working for me:

For initial install and init

bun add shadcn-ui@latest bun x shadcn-ui init

For adding any components, just use bun x instead of bunx:

bun x --bun shadcn-ui@latest add button

VAaRrUNn avatar Jul 24 '24 04:07 VAaRrUNn

bunx --bun shadcn@latest init instead of bunx shadcn-ui@latest init

don't put the ui in

10d3 avatar Sep 02 '24 15:09 10d3

Thank you @10d3 , that fixed the issue on my side.

AnasMostefaoui avatar Sep 08 '24 12:09 AnasMostefaoui

guys, its fixed with bunx --bun shadcn@latest init

Sisableng avatar Sep 13 '24 17:09 Sisableng

$ bun x --bun shadcn@latest add dialog error: could not determine executable to run for package shadcn

AngelBlackBlue avatar Jan 23 '25 00:01 AngelBlackBlue

@AngelBlackBlue

$ bunx not bun x

anhwrkspx avatar Feb 15 '25 10:02 anhwrkspx