2

I'm trying to run:

npx @contentful/create-contentful-app init contentful-refs

However this fails and throws the following errors:

You are running create-react-app 4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React App.

I went ahead and deleted npm, nvm, npx, create-react-app, create-contentful-app. I checked that they were not on my machine, then I updated to the latest versions of each. and tried running the initial command. I'm still getting the same issue, and now after installing the latest version of create-react-app, create-react-app is still not found on my machine. Not sure what to do here, any help would be greatly appreciated.

SocaBlood
  • 167
  • 1
  • 12

7 Answers7

3

Try this command.

sudo npm i create-react-app@5.0.0
Muhammad Dyas Yaskur
  • 6,914
  • 10
  • 48
  • 73
3

Ask for the latest version: npx create-react-app@latest your-app-name

JonPynes
  • 35
  • 4
  • 1
    Please read [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer). While this code block may answer the OP's question, this answer would be much more useful if you explain how this code is different from the code in the question, what you've changed, why you've changed it and why that solves the problem without introducing others. – Saeed Zhiany Jul 04 '22 at 02:53
2

Try this command npx create-react-app@5.0.0 app-name

2

I solved this issue by doing the following things:-

  1. Updating my node version to v14.15.0 using nvm(https://phoenixnap.com/kb/update-node-js-version)

  2. updating my npm version

    npm i -g npm@latest

  3. npx create-react-app@5.0.0 your-app-name

1

I too faced this issue, I deleted the _npx folder and than ran npx create-react-app my-app and the project folder was created.

_npx path : %\AppData\Local\npm-cache_npx

Karan V
  • 11
  • 1
1

Turns out the issue was with the contentful package "@contentful/create-contentful-app". The latest React update broke their package, they have since updated it with a fix.

SocaBlood
  • 167
  • 1
  • 12
0

If the issue persists even after uninstalling create-react-app globally.

Try

npm cache clean -f

OR

Delete the _npx folder found in:

C:\Users\<username>\AppData\Local\npm-cache

create-react-app seems to work now

npx create-react-app foo
insaan
  • 29
  • 1
  • 8