Search code examples
reactjsnpmcreate-react-appnpx

I am having an error while installing Create-react-app


I want to get started with React.js and I am following their official documentation that states to use - npx create-react-app my-app to install the app, but I am getting the error below every time. Please help

enter image description here


Solution

  • You can try the following ways to resolve the error -

    1. Delete everything from C:\Users\your_pc_name\AppData\Roaming\npm-cache

    2. This could be a local caching issue. Try the command npm cache clean --force using administrator mode in your terminal and then try again with the same command - npx create-react-app my-app.

    3. If the above command doesn't work, try the same command or another similiar command - npm cache clear --force and then npm install after that. After this, you can run the commands to setup your react project and see if it works.

    These were the point I have referred online from people who faced a similar issue. Try to see if any of the above steps resolve your issue.

    I have aggregated the working solutions but if this still doesn't solve your problem, you could refer the links mentioning a similar problem -