Search code examples
reactjscreate-react-app

I tried to create new react app with npx create-react-app but it's not working


`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

Solution

  • 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