4

I have followed the standard procedure (npm uninstall -g create-react-app and yarn global remove create-react-app) to remove my previous global installation of create-react-app using yarn as shown in the screenshot below. I have also checked that the following directory does not exist: /usr/local/bin/create-react-app.

However, I still get errors when using npx create-react-app myapp, saying that I am running create-react-app 4.0.0.

which create-react-app

also outputs nothing.

Hence, I am looking for a way to resolve this issue. Screenshot of terminal

Jia Cheng Sun
  • 77
  • 1
  • 2
  • 8
  • Are you sure you don’t have it installed locally in the current folder you’re in? – JBallin Dec 05 '20 at 08:51
  • 1
    I would like to close my question if I can, but I do not have enough rep. Since I have deleted this VM, I will not be able to check if the proposed solutions work. – Jia Cheng Sun Dec 06 '20 at 12:12
  • 1
    I’ve flagged it for the moderators to close the question. – JBallin Dec 06 '20 at 18:55

1 Answers1

1

Double check the NPM cache:

npm config get cache | xargs ls -tr | grep create-react-app

If it shows anything, delete it:

npm config get cache | xargs ls -tr | grep create-react-app | xargs rm -rf

If this still fails, try installing the latest stable version:

npm install -g npm@latest

Also, if it still doesn't work with npx, try with instead npm:

npm create-react-app myapp
costaparas
  • 4,779
  • 11
  • 15
  • 26
  • 1
    Appreciate the reply! Unfortunately, I have deleted this instance of my VM already and have reverted to a backup, so I would not be able to verify if this works. – Jia Cheng Sun Dec 06 '20 at 12:09