ui
ui copied to clipboard
[bug]: Error adding shadcn for Turborepo
Describe the bug
Unable to add shadcn using turborepo.
npx shadcn@canary init
✔ Preflight checks. ✖ Verifying framework.
We could not detect a supported framework at /app-name. Visit https://ui.shadcn.com/docs/installation/manual to manually configure your project. Once configured, you can use the cli to add components.
Affected component/components
Not installing
How to reproduce
- Create monorepo using turborepo
- Run shadcn/ui CLI to add for monorepo
Codesandbox/StackBlitz link
No response
Logs
System Info
System, pnpm
Before submitting
- [x] I've made research efforts and searched the documentation
- [x] I've searched for existing issues
I think you're doing it backwards, try without creating the turborepo.
In the docs it says running the pnpm dlx shadcn@canary init command will prompt you to select Next.js (Monorepo) which I assume will create the turborepo in its build process.
I think you're doing it backwards, try without creating the turborepo.
In the docs it says running the
pnpm dlx shadcn@canary initcommand will prompt you to selectNext.js (Monorepo)which I assume will create the turborepo in its build process.
This dosent works either.
it just fails!
➜ ~ pnpm dlx shadcn@canary init
✔ The path /home/kedar does not contain a package.json file.
Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … my-app
✖ Something went wrong creating a new Next.js monorepo.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.
Command failed with ENOENT: cd /home/kedar
spawn cd ENOENT
I found a workaround, not the best way but it worked for me
bunx shadcn@canary init
it will throw error saying bun install failed but the basic structure will have been created by now
then you can cd into your project and run
pnpm install
just make sure you change the pnpm version in pacakage.json to the one you are installing.
Its the only way i came across to initiate project.
FYI idk why
pnpm dlx shadcn@canary init
works perfectly on macOS only idk whats wrong on linux or windows
Edit:
pnpm dlx shadcn@canary init
this works in windows CMD too but if i run that on gitbash it fails
@devWithKD Worked in cmd for me as well
same issue.
same issue.
same
same
same
same