How to Fix “Parsing error: Cannot find module ‘next/babel'” in Next.js

Create file called .babelrc in your root directory and add this code

{
  "presets": ["next/babel"],
  "plugins": []
}

And in .eslintrc replace the existing code with

{
  "extends": ["next/babel"]
}

How to Fix Problems w/ create-react-app

Possible Problems

You run npx create-react-app my-app and it only tells you npx installed without generating a new project.

You successfully create a new React project but there’s no server.js file in the project. It may give you this error when you run npm start: “missing script: start”

Solution

Installing create-react-app globally is now discouraged. Instead uninstall globally installed create-react-app package by doing:

npm uninstall -g create-react-app

Then, just try creating a new React project:

npx create-react-app my-app