Next.js: "npx create-next-app" is not working React v17.0 reason

Created on 24 Oct 2020  Â·  4Comments  Â·  Source: vercel/next.js

Bug report

"npx create-next-app" is not working because npm couldn't resolve dependency peer react@"^16.6.0" of [email protected] with [email protected].

Describe the bug

Console log there.

ryota.murakami@MacBook-Pro ~/lab> npx create-next-app
✔ What is your project named? … next.js-render-lifecycle-learning
Creating a new Next.js app in /Users/ryota.murakami/lab/next.js-render-lifecycle-learning.

Installing react, react-dom, and next using npm...

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@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.6.0" from [email protected]
npm ERR! node_modules/next
npm ERR!   next@"*" 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! See /Users/ryota.murakami/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ryota.murakami/.npm/_logs/2020-10-24T09_12_40_212Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom next has failed.

To Reproduce

Run bellow command.

npx create-next-app

System information

  • OS: macOS 10.15.7
  • Version of Next.js: 9.55
  • Version of Node.js: 14.13.1

Additonal context

Personally I've got resolve solution like this.

  1. npm i -g create-next-app
  2. create-next-app

But npx create-next-app is showing top of the head of official getting start guide.
So npx create-next-app has unstability is not good for especially new comer.

I guess introduce stable command instead of latest one in getting started page or adding fall back solution like above is becoming better than right now.

Most helpful comment

This has been fixed with next@canary already.

All 4 comments

This has been fixed with next@canary already.

@timneutkens Thank you, I'll close it.

I have same problems. how did u solve this issue?

Having the same issues. I'm using npm init next-app nextjs-blog --example "https://github.com/vercel/next-learn-starter/tree/master/learn-starter" to start the tutorial now and it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickredmark picture nickredmark  Â·  60Comments

timneutkens picture timneutkens  Â·  72Comments

acanimal picture acanimal  Â·  74Comments

rauchg picture rauchg  Â·  208Comments

arunoda picture arunoda  Â·  103Comments