Skip to content
Discussion options

You must be logged in to vote

This is a common issue with shadcn/ui + Turborepo + npm. The problem is that shadcn CLI has some compatibility issues with npm workspaces in certain Turborepo setups.

The fix that works for most people:

Option 1: Use the --legacy-peer-deps flag

npm install --legacy-peer-deps

Option 2: Initialize with the correct workspace flag
When running npx shadcn@latest init inside a workspace package, make sure you run it from inside the specific app directory, not the monorepo root:

cd apps/your-app
npx shadcn@latest init

Option 3: Add npmClient to turbo.json

{
  "$schema": "https://turbo.build/schema.json",
  "npmClient": "npm"
}

Option 4: Set workspaces in root package.json
Make sure your root pac…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shivam-070208
Comment options

Answer selected by shivam-070208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants