score:1

Accepted answer
  1. Options 1
    Switch to yarn instead of npm
    npm i -g yarn
    yarn create react-app
    
  2. Options 2
    Uninstal Node completely and re-instal it again
  3. Option 3
    Use nvm (Node Version Manager)

score:0

When it gives you this error, it asks your permission to install create-react-app

...
Ok to proceed? (y)

Type y in your terminal and press enter

You might find this helpful as well: https://create-react-app.dev/docs/getting-started/

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

score:0

could you try to add this path to your system variable? C:\Users\<user-name>\AppData\Roaming\npm

and try again with npx create-react-app <app-name>

score:0

You need to clear your npx cache first.

Delete the folder _npx inside the path returned by npm config get cache

# In Linux/MacOS terminal
rm -rf `npm config get cache`/_npx

This can also be done with @snewn's method, I posted this in case you want to skip that dependency.

score:0

Need to clear the cache on the npx:

npx clear-npx-cache and then re-run

npx create-react-app and then accept (y)

score:1

When it said Ok to proceed? (y) I went through that twice and it told me the version I was using was no longer supported so, npm update

score:1

Hi Oussama Bouchikhi,

You can try the following npm commands to solve the issue:

Run this first,

npm uninstall -g create-react-app

then

npm install -g create-react-app

Here's the snapshot of the same, create-react-app-issue

Let us know if it works! Happy Hacking!

score:2

Just clear the cache by running, npx clear-npx-cache and then try to create your react app npx creact-react-app my-app.

score:14

Just had the same problem. This worked for me:

  • npm -g uninstall create-react-app
  • npm cache clean --force
  • npm install -g create-react-app
  • npx create-react-app my-app

score:33

Need to clear the cache on the npx:

npx clear-npx-cache

and then re-run

npx create-react-app <app-name>

and then accept (y)


Related Query

More Query from same tag