ui icon indicating copy to clipboard operation
ui copied to clipboard

[bug]: Unable to create new project in new method in pnpm

Open Shakil-Ahmmed-One opened this issue 1 week ago • 4 comments

Describe the bug

Tried to create a new project with this command using pnpm: pnpm dlx shadcn@latest create --preset "https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start" --template start

`pnpm dlx shadcn@latest create --preset "https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start" --template start √ What is your project named? ... blood-bank √ Which template would you like to use? » TanStack Start

Something went wrong. Please check the error below for more details. If the problem persists, please open an issue on GitHub.

Message: Failed to fetch from registry (400): https://ui.shadcn.com/init?base=base

Suggestion: There was a client error. Check your request parameters.

'style' is not recognized as an internal or external command, operable program or batch file. 'baseColor' is not recognized as an internal or external command, operable program or batch file. 'theme' is not recognized as an internal or external command, operable program or batch file. 'iconLibrary' is not recognized as an internal or external command, operable program or batch file. 'font' is not recognized as an internal or external command, operable program or batch file. 'menuAccent' is not recognized as an internal or external command, operable program or batch file. 'menuColor' is not recognized as an internal or external command, operable program or batch file. 'radius' is not recognized as an internal or external command, operable program or batch file. 'template' is not recognized as an internal or external command, operable program or batch file.`

But the code works fine in bun: bunx --bun shadcn@latest create --preset "https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start" --template start

`bunx --bun shadcn@latest create --preset "https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start" --template start √ What is your project named? ... blood-bank ✔ Creating a new TanStack Start project. ✔ Writing components.json. ✔ Checking registry. ✔ Updating CSS variables in src\styles.css ✔ Updating src\styles.css ✔ Installing dependencies. ✔ Created 1 file:

  • src\lib\utils.ts

Success! Project initialization completed. You may now add components.`

Affected component/components

All

How to reproduce

  1. Open terminal
  2. Type this command (pnpm dlx shadcn@latest create --preset "https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start" --template start (Install pnpm if have not)

Codesandbox/StackBlitz link

No response

Logs


System Info

Windows 11

Before submitting

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

Shakil-Ahmmed-One avatar Dec 14 '25 09:12 Shakil-Ahmmed-One

Status

No issue found in my case

I tested the same command and it worked correctly without any errors. The project was created successfully using the same preset and template.

Root Cause of the Reported Issue

The error occurs due to Windows shell + pnpm argument parsing.

On Windows, pnpm dlx may incorrectly parse URLs containing &.
As a result, query parameters like style, baseColor, theme, etc. are treated as separate shell commands, leading to errors such as: 'style' is not recognized as an internal or external command.

This also causes the registry request to be truncated, resulting in a 400 fetch error.

Why It Works with bun

bunx handles quoted URLs correctly and does not split arguments on &, so the same command works without issues.

Fix / Recommendation

  • Escape & characters when using pnpm on Windows, or
  • Use bunx, which avoids this issue entirely

Workarounds

Option 1 (Recommended for Windows)

Escape & characters when using pnpm:

pnpm dlx shadcn@latest create --preset "https://ui.shadcn.com/init?base=base^&style=vega^&baseColor=neutral^&theme=neutral^&iconLibrary=tabler^&font=inter^&menuAccent=subtle^&menuColor=default^&radius=small^&template=start" --template start

Option 2 (Git Bash Only)

Use 'single quotes' to prevent argument splitting:

pnpm dlx shadcn@latest create --preset 'https://ui.shadcn.com/init?base=base&style=vega&baseColor=neutral&theme=neutral&iconLibrary=tabler&font=inter&menuAccent=subtle&menuColor=default&radius=small&template=start' --template start

Conclusion

  • This is not a shadcn issue.
  • It is an environment-specific issue related to pnpm + Windows shell parsing.

GitLakshman avatar Dec 14 '25 11:12 GitLakshman

same issue:

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Message:
Failed to fetch from registry (400): https://ui.shadcn.com/init?base=radix&style=vega&baseColor=neutral&theme=neutral&iconLibrary=lucide&font=geist&menuAccent=subtle&menuColor=default&radius=default&template=next

Suggestion:
There was a client error. Check your request parameters.

even change font or icon packages

ehsanghaffar avatar Dec 14 '25 15:12 ehsanghaffar

Instead of pnpm dlx... do pnpm --% dlx...

mhamid3d avatar Dec 14 '25 23:12 mhamid3d

In PowerShell, characters such as ?, &, and = are considered operators, not just simple characters. This is the cause of the issue in PowerShell. Try using Git Bash instead.

yeasin2002 avatar Dec 15 '25 04:12 yeasin2002

Try accessing the URL that returns a 400 error directly in your browser—you'll see the specific error message. Once you fix it based on that, it should work fine.

eastack avatar Dec 17 '25 14:12 eastack

Does not work on Mac either. Tried above methods, still not working. It hangs and no file is created:

pnpm dlx shadcn@latest create --preset "https://ui.shadcn.com/init?base=radix&style=mira&baseColor=zinc&theme=emerald&iconLibrary=lucide&font=inter&menuAccent=subtle&menuColor=default&radius=none&template=vite" --template vite
✔ What is your project named? … y-admin
⠼ Creating a new Vite project. This may take a few minutes.

bunx works.

drriguz avatar Dec 17 '25 16:12 drriguz

Use Command Prompt in windows. for some reasons it does not work with Windows PowerShell

sayedsadat344 avatar Dec 18 '25 10:12 sayedsadat344

Ubuntu. (vpn, no-vpn, npm, pnpm, empy dir) not working

teleskop150750 avatar Dec 18 '25 20:12 teleskop150750

i got the same error on mac also

beng970804 avatar Dec 19 '25 13:12 beng970804

Same issue here, tried PS, CMD, and tried escaping, also tried using the template name by writing radix-lyra and still get the same error!.

binn avatar Dec 19 '25 23:12 binn

Use Command Prompt in windows. for some reasons it does not work with Windows PowerShell

In PowerShell, characters such as ?, &, and = are considered operators, not just simple characters. This is the cause of the issue in PowerShell (2)

yeasin2002 avatar Dec 20 '25 04:12 yeasin2002