Monorepo initialization err wiht npm #10210
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
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 npm install --legacy-peer-depsOption 2: Initialize with the correct workspace flag cd apps/your-app
npx shadcn@latest initOption 3: Add {
"$schema": "https://turbo.build/schema.json",
"npmClient": "npm"
}Option 4: Set {
"workspaces": ["apps/*", "packages/*"]
}If you can share the actual error output (text, not just a screenshot), it would help narrow down the exact cause. |
Beta Was this translation helpful? Give feedback.

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-depsflagOption 2: Initialize with the correct workspace flag
When running
npx shadcn@latest initinside 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 initOption 3: Add
npmClientto turbo.json{ "$schema": "https://turbo.build/schema.json", "npmClient": "npm" }Option 4: Set
workspacesin rootpackage.jsonMake sure your root
pac…