Next.js Discord

Discord Forum

Need help with setting up NPM on MacOS for NextJS tutorial

Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Open in Discord
Cuvier’s Dwarf CaimanOP
When running the pnpm i command on the NextJS tutorial, I am currently encountering issues with dependencies, and I am not yet sure how to resolve them. Force fixing the errors only generates more problems.

35 Replies

Netherland Dwarf
Can you show the full error message
Cuvier’s Dwarf CaimanOP
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.3
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/me/.npm/_logs/2024-06-17T15_39_18_105Z-eresolve-report.txt

npm error A complete log of this run can be found in: /Users/me/.npm/_logs/2024-06-17T15_39_18_105Z-debug-0.log
Apologies in advance, but I have like no knowledge of JS
Netherland Dwarf
Is this a cloned repo?
Cuvier’s Dwarf CaimanOP
Yup. Straight from the NextJS tutorial page.
Netherland Dwarf
This command:

npx create-next-app@latest
Okay so did that work?
Cuvier’s Dwarf CaimanOP
Running it now
Netherland Dwarf
Its the same command you did
In that page
So if that worked then you dont have to do it
Yeah do that command worked?
Cuvier’s Dwarf CaimanOP
Running it now
It worked, but I got a bunch of warnings about deprecated libraries
Netherland Dwarf
Hmm can you start the dev server
Npm run dev
Just to verify everything is working
Cuvier’s Dwarf CaimanOP
That worked
Netherland Dwarf
Okay, so did that solve your issue?
Cuvier’s Dwarf CaimanOP
I...think so? Does that obviate the need to do pnpm i?
That was the command that really threw a wrench in things for me.
Once again, apologies for knowing basically no JS
Netherland Dwarf
Pnpm is just a different packae manager
Im not familiar with it
Cuvier’s Dwarf CaimanOP
Ah. In that case, I guess problem solved. Thanks a tonne!
@Cuvier’s Dwarf Caiman if you still wanna use the example dashboard starter repo run this:

npx create-next-app@latest nextjs-dashboard-patched --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" && cd nextjs-dashboard-patched && npm install --legacy-peer-deps && npm install --legacy-peer-deps
make sure you're not inside the other repo's folder when you run it because it will create a new project
Actually, this is pretty disappointing the repo seems pretty broken. I'd go for a YouTube tutorial or something tbh
Like the other guy said use that shorter command and build from there, good luck!
yarn create next-app nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example"
this seems to work
Cuvier’s Dwarf CaimanOP
Package managers, why are you the way you are? As someone who's new to JS in general...the language feels a lot more confusing than I expected.