question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Bug report

“npx create-next-app” is not working because npm couldn’t resolve dependency peer react@"^16.6.0" of next@9.5.5 with react@17.0.1.

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: next.js-render-lifecycle-learning@0.1.0
npm ERR! Found: react@17.0.1
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 next@9.5.5
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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
adil-waqarcommented, Jan 21, 2021

First install create-next-app globally and with npm i -g create-next-app and then try doing create-next-app. This fixed it for me. 😃

6reactions
timneutkenscommented, Oct 24, 2020

This has been fixed with next@canary already.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create React App not working - Stack Overflow
1. update the npm version (npm install npm@latest -g) · 2. clear the cache (npm cache clean --force) · 3. create the react...
Read more >
React v17.0 – React Blog
No New Features ... The React 17 release is unusual because it doesn't add any new developer-facing features. Instead, this release is primarily ......
Read more >
create-next-app - npm
Create Next.js-powered React apps with one command. ... Start using create-next-app in your project by running `npm i create-next-app`.
Read more >
STOP Using Create React App - YouTube
Create React App is a plague and we're here to cure it. Please use Vite, NextJS, or Remix instead. Seriously, anything is better...
Read more >
Need help: npx create-react-app not working : r/reactjs - Reddit
0 ). Edit 2: I found out that this problem also happens with create-next-app :(. Please, I need help, the last two ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found