Next.js Discord

Discord Forum

npx create-next-app unable to resolve dependency tree

Answered
West African Lion posted this in #help-forum
Open in Discord
West African LionOP
First step from https://nextjs.org/learn/dashboard-app/getting-started and I'm getting the following:

npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" Creating a new Next.js app in /Users/X/Dev/Learn Next.js/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/jmbuytaert/.npm/_logs/2024-06-20T00_52_05_802Z-eresolve-report.txt npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2024-06-20T00_52_05_802Z-debug-0.log Aborting installation. npm install has failed.

Any idea what's going on? First step and I can't move forward.
Answered by joulev
this error is i think npm's fault, install pnpm and use it instead https://pnpm.io
View full answer

5 Replies

West African LionOP
Update: I ran npm install --legacy-peer-deps and there are 2 high severity vulnerabilities:

ws  8.0.0 - 8.17.0
Severity: high
ws affected by a DoS when handling a request with many HTTP headers - https://github.com/advisories/GHSA-3h5v-q93c-6h6q
No fix available
node_modules/ws
  @vercel/postgres  *
  Depends on vulnerable versions of ws
  node_modules/@vercel/postgres

2 high severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.


I tried moving forward to the next step and running pnpm i and I get this error:
command not found: pnpm 😠

Can anyone help please?
@West African Lion First step from https://nextjs.org/learn/dashboard-app/getting-started and I'm getting the following: `npx create-next-app@latest nextjs-dashboard --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example" Creating a new Next.js app in /Users/X/Dev/Learn Next.js/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/jmbuytaert/.npm/_logs/2024-06-20T00_52_05_802Z-eresolve-report.txt npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2024-06-20T00_52_05_802Z-debug-0.log Aborting installation. npm install has failed.` Any idea what's going on? First step and I can't move forward.
this error is i think npm's fault, install pnpm and use it instead https://pnpm.io
Answer
@joulev this error is i think npm's fault, install pnpm and use it instead <https://pnpm.io>
West African LionOP
Thank you for the quick reply!
West African LionOP
Yes it did! Thank you!