vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.39k stars 1.79k forks source link

error with starter-example #752

Closed luciostuder closed 1 week ago

luciostuder commented 1 week ago

Hi,

When I run npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example"

I get this error

Creating a new Next.js app in /Users/luciostuder/Desktop/NextJS/tutorial nextjs vercel/nextjs-dashboard.

Downloading files from repo https://github.com/vercel/next-learn/tree/main/dashboard/starter-example. This might take a moment.

Installing packages. This might take a couple of minutes.

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: undefined@undefined
npm error Found: react@19.0.0-rc-6230622a1a-20240610
npm error node_modules/react
npm error   react@"19.0.0-rc-6230622a1a-20240610" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@">= 16" from @heroicons/react@2.1.4
npm error node_modules/@heroicons/react
npm error   @heroicons/react@"^2.0.18" 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/luciostuder/.npm/_logs/2024-06-18T23_53_05_722Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/luciostuder/.npm/_logs/2024-06-18T23_53_05_722Z-debug-0.log

Aborting installation.
  npm install has failed.
jambudipa commented 1 week ago

Yes, this is unfortunate. Been like this for a good while now, would really like to make a start learning this. When will it be sorted?

triggerAustin commented 1 week ago

Found a fix in one of the issues posted.

npm install -g pnpm pnpm i to install dependencies pnpm run dev to start development server

jambudipa commented 1 week ago

@triggerAustin

So that works, but I don't want to use react rc 19...

How can I use the v18 next tutorial stuff? Is it a case of pulling another branch or something?

jambudipa commented 1 week ago

So I did this:

npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/next-learn/dashboard/starter-example"

This pulls from the next-learn branch, which uses react v18

approxahmed commented 1 week ago

So I did this:

npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/next-learn/dashboard/starter-example"

This pulls from the next-learn branch, which uses react v18

I was able to start the dev server after following this, thanks

leerob commented 1 week ago

https://github.com/vercel/next-learn/issues/754#issuecomment-2185323453