ui
ui copied to clipboard
[bug]: Problem While Installing SHADCN on NextJS 15
Describe the bug
Problem While Installing SHADCN on NextJS 15
Affected component/components
Installation
How to reproduce
- Install NextJS with v 15
- Try to install shadcn
Codesandbox/StackBlitz link
https://github.com/SH20RAJ/article
Logs
shaswatraj@Sh article % npx shadcn-ui init
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
✔ Which style would you like to use? › Default
✔ Which color would you like to use as base color? › Slate
✔ Would you like to use CSS variables for colors? … no / yes
✔ Writing components.json...
✔ Initializing project...
⠦ Installing dependencies...Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error react@"19.0.0-rc-f994737d14-20240522" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.5.1 || ^17.0.0 || ^18.0.0" from [email protected]
npm error node_modules/lucide-react
npm error lucide-react@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/shaswatraj/.npm/_logs/2024-06-20T01_13_53_671Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/shaswatraj/.npm/_logs/2024-06-20T01_13_53_671Z-debug-0.log
shaswatraj@Sh article %
System Info
Mac,Chrome
Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
as the error says lucide-react peer dependency mismatch with react 19
downgrading to 18 could be a solution or
use --force --legacy-peer-deps flags to npm install
lucide-react now supports "react":^19.0.0 but not rc(release candidate)
https://github.com/lucide-icons/lucide/issues/2134#event-13293674013
For now, this is the solution it's working for me. This is just one more pain I've got for using next 15@rc npm install tailwindcss-animate class-variance-authority clsx tailwind-merge [email protected] --legacy-peer-deps
check the blog solve this problem https://tutorialsmaterial.com/post/ShadCn-Nextjs-15