Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Next.js 15 Stable : Cannot Install Any Library #5597

Closed
2 tasks done
Grenish opened this issue Oct 27, 2024 · 6 comments
Closed
2 tasks done

[bug]: Next.js 15 Stable : Cannot Install Any Library #5597

Grenish opened this issue Oct 27, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Grenish
Copy link

Grenish commented Oct 27, 2024

Describe the bug

After installing next.js 15 stable with turbopack I'm getting errors while installing any libraries even shadcn/ui

npx shadcn@latest init
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
√ Which style would you like to use? » New York
√ Which color would you like to use as the base color? » Neutral
√ Would you like to use CSS variables for theming? ... no / yes
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.ts
✔ Updating app\globals.css
⠸ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority lucide-react @radix-ui/react-icons clsx tailwind-merge
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"19.0.0-rc-69d4b800-20241021" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.x || ^17.x || ^18.x" from @radix-ui/[email protected]
npm ERR! node_modules/@radix-ui/react-icons
npm ERR!   @radix-ui/react-icons@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Grenish\AppData\Local\npm-cache\_logs\2024-10-27T14_00_01_841Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\Grenish\AppData\Local\npm-cache\_logs\2024-10-27T14_00_01_841Z-debug-0.log

Also at first I thought it might be because of turbopack so I redo it again with opting no for turbopack but the issue still persists.

Affected component/components

Everything

How to reproduce

  1. npx create-next-app@latest .
  2. Install any dependencies npx shadcn@latest init or npm install next-themes lucid-react

Codesandbox/StackBlitz link

https://github.com/Grenish/porfolio

Logs

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority lucide-react @radix-ui/react-icons clsx tailwind-merge
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"19.0.0-rc-69d4b800-20241021" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.x || ^17.x || ^18.x" from @radix-ui/[email protected]
npm ERR! node_modules/@radix-ui/react-icons
npm ERR!   @radix-ui/react-icons@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Grenish\AppData\Local\npm-cache\_logs\2024-10-27T14_00_01_841Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\Grenish\AppData\Local\npm-cache\_logs\2024-10-27T14_00_01_841Z-debug-0.log

System Info

Device name	LAPTOP-1671HG5P
Processor	12th Gen Intel(R) Core(TM) i5-12450H   2.00 GHz
Installed RAM	8.00 GB (7.68 GB usable)
Device ID	FE68204F-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Product ID	00356-xxxxx-xxxxx-xxxxx
System type	64-bit operating system, x64-based processor
Pen and touch	No pen or touch input is available for this display

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@Grenish Grenish added the bug Something isn't working label Oct 27, 2024
@VincentBarkman
Copy link

Yeah, same issue but downgrading to react 18 seems to have solved it. However that is just a bandage:

npm install react@18 react-dom@18

@tutorialsmaterials
Copy link

check the blog solve this problem
https://tutorialsmaterial.com/post/ShadCn-Nextjs-15

@VincentBarkman
Copy link

@tutorialsmaterials don't advertise your blog like that, especially when the solution adds more problems and a layer of complexity.

@shadcn
Copy link
Collaborator

shadcn commented Oct 28, 2024

I'm working on a fix. Let's use #5557 to track since they are related.

@shadcn shadcn closed this as completed Oct 28, 2024
@Grenish
Copy link
Author

Grenish commented Oct 30, 2024

@VincentBarkman Yeah after downgrading to react 18, it's working fine.

@Grenish
Copy link
Author

Grenish commented Oct 30, 2024

@shadcn Best of luck with that. Also now when we install shadcn we get an extra option to use --force or --legacy-peer-deps but for now downgrading to react 18 seems to be a viable option for now. Hope it get's resolve in the future for react 19 RC and 19 stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants