#Starter Example failed to load.

10 messages · Page 1 of 1 (latest)

clear fjord
#

Hi, I'm following the tutorial on the next.js website. there so from the tutorial I'm using starter example.
When I try to run command:
npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example"
It throws this error:
`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: [email protected]
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/[email protected]
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 /home/imtiapy/.npm/_logs/2024-06-11T20_46_55_522Z-eresolve-report.txt

npm error A complete log of this run can be found in: /home/imtiapy/.npm/_logs/2024-06-11T20_46_55_522Z-debug-0.log

Aborting installation.
npm install has failed.
However when I don't use the starter-example and go with the main command:npx create-next-app@latest` it runs perfectly and installs the dependency.

How can I resolve the issue with the starter-example?

royal hemlockBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

zealous jackal
#

The issue you're encountering is due to a conflict in the dependencies specified in the starter-example from the Next.js tutorial. The specific conflict is between the version of React specified in the example and the version required by @heroicons/react.

Can you try using --legacy-peer-deps (it tells npm to ignore peer depedency conflicts and proceed with the installation). Here is the command:

clear fjord
#

I tried with both --legacy-peer-deps and --force flags. Both throws the same error

clear fjord
#

if the conflict is between the version of React specified in the example and the version required by @heroicons/react, I think we can specify the required version React by @heroicons/react in the package.json.

Another point is that, if the purpose of example code to get the learner straight away into learning the core features of Next.JS, why not solving it?

clear fjord
#

I tried removing the @heroicons/react from the package.json and install with npm install.
Still throws the same error

zealous jackal
#

Have you tried using yarn instead of npm?

clear fjord
#

Great. It's working with yarn
I first copied the example code from the github repo, then run the installation with yarn.

zealous jackal
#

Glad to know that helped!