[bug]: Unable to create new project in new method in pnpm
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
- Open terminal
- 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
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 usingpnpmon 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.
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
Instead of pnpm dlx... do pnpm --% dlx...
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.
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.
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.
Use Command Prompt in windows.
for some reasons it does not work with Windows PowerShell
Ubuntu. (vpn, no-vpn, npm, pnpm, empy dir) not working
i got the same error on mac also
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!.
Use
Command Promptin windows. for some reasons it does not work withWindows PowerShell
In PowerShell, characters such as ?, &, and = are considered operators, not just simple characters. This is the cause of the issue in PowerShell (2)