ui icon indicating copy to clipboard operation
ui copied to clipboard

[bug]: npx shdnc@latest url stuck at "Installing dependencies"

Open 3IMAD69 opened this issue 1 year ago • 2 comments

Describe the bug

When I run npx shdnc@latest url, the process gets stuck at the "Installing dependencies" step and does not proceed

Affected component/components

Cannot install any component using the cli

How to reproduce

Run npx shadcn@latest add "https://v0.dev/chat/b/b_wslkIiIMLhs?token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..pt0lLMnobX0YxVIb._Fh59fncD8EAU8BlmQgAaC25DK0KqCgq4R86zw28bkXG-Hrg83lQmkIynis.I42dFW87PMfK4Fq5j_Ht5g"

Observe that the process stalls at "Installing dependencies."

Codesandbox/StackBlitz link

No response

Logs

Checking registry.
Installing dependencies

System Info

Ubuntu 24.04
node v22.11.0
bun 1.1.34

Before submitting

  • [X] I've made research efforts and searched the documentation
  • [X] I've searched for existing issues

3IMAD69 avatar Nov 15 '24 00:11 3IMAD69

I experience this quite a lot too and what works for me is probably unrelated to what you're experiencing but I'm leaving this for someone with my specific problem.

Fix: Use a VPN

Not sure why this is what works for me anytime I'm experiencing this but... I do hope it helps someone.

Emmaccen avatar Apr 25 '25 15:04 Emmaccen

i actually used bunx instead of npx and it works

3IMAD69 avatar Apr 25 '25 17:04 3IMAD69

bunx doesn't work either for me. notably just bun add @radix-ui/react-switch gets stuck

zpg6 avatar Jul 04 '25 12:07 zpg6

I am experiencing this in a bun monorepo. After some debugging it appears that @antfu/ni (called from getPackageManager, from getUpdateDependenciesPackageManager, from installWithPackageManager, from updateDependencies which is where the Installing dependencies spinner is run) is detecting yarn instead of bun, because it's not seeing the bun.lock in the cwd (because it's in the root of the repo). touch bun.lock in the working directory was an acceptable workaround, I just delete it when I'm done installing things then re-run bun install to be sure the root bun.lock is as it should be.

Edit: and the reason was actually my fault: I had "packageManager": "yarn" in my root package.json somehow.

John-Colvin avatar Aug 17 '25 17:08 John-Colvin

  1. sudo pnpm add -D tw-animate-css
  2. sudo pnpm dlx shadcn@latest add xxxxxx

it's ok, you can try...

ishidai avatar Nov 20 '25 11:11 ishidai