1
`npx create-react-app` is not working I tried `npm uninstall -g create-react-app` and `npm cache clean --force` but it is still not working.

Here is the error message:

    npm ERR! Unexpected end of JSON input while parsing near '..."optional":true}},"fu'
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\Zee\AppData\Roaming\npm-cache\_logs\2021-10-13T16_22_36_156Z-debug.log
  • 1
    Remember that "it's not working" is not a problem description, and remember to show [all the details](/help/how-to-ask) because that's not the entire error message. – Mike 'Pomax' Kamermans Oct 13 '21 at 16:41
  • https://stackoverflow.com/questions/47843056/create-react-app-not-workin Checkout this thread there are some recommendations – chanuka_dsc Oct 13 '21 at 16:41

3 Answers3

0

First of all, You will have to name the app while running the command:

npx create-react-app my-app

Secondly, if the error still persists, there are primarily two possibilities for this type of error:

  1. You have an outdated npm version.
  2. You have a poor or unstable internet connection.
Winter
  • 331
  • 1
  • 8
0

You’ll need to have Node >= 14.0.0 and npm >= 5.6 on your machine. To create a project, run:

npx create-react-app my-app
cd my-app
npm start
  1. To check the Node version, Go to the terminal and type the command node -v or node --version
  2. And to check the npm version, type npm -v or npm --version

For more details check the official docs:

https://reactjs.org/docs/create-a-new-react-app.html

Imran Rafiq Rather
  • 7,677
  • 1
  • 16
  • 35
0

The best way to solve errors when dealing with create-react-app is to uninstall node-js and install it back again. Hope this helps