3

I have the exact same problem as this question. I have tried the following possible solutions

npx clear-npx-cache

output

Need to install the following packages:
  clear-npx-cache
Ok to proceed? (y) y

npm uninstall -g create-react-app

output

removed 67 packages, and audited 1 package in 380ms

found 0 vulnerabilities

npm install -g create-react-app@5.0.0 and it got installed successfully. After this when I tried npx create-react-app frontend it gave the same error that I was using 4.0.3 version of 'create-react-app'

this means that the npx cache is not cleared as it was supposed to. It is worth mentioning that I am using nvm to manage my node version and am on Ubuntu 21.1 for this reason I checked out where my react scripts were

npm ls -g create-react-app

output

/home/vaibhav/.nvm/versions/node/v16.14.0/lib
`-- (empty)

also I suppose the above command to clear npx cache actually deletes the _npx folder? I may be wrong here but the _npx folder is actually located in here

/home/vaibhav/.npm/npx

I just want to install the latest version of create-react-app scripts in the global directory hope the above information would be enough.

Vaibhav07
  • 223
  • 2
  • 10

1 Answers1

1

I faced the same problem, so I ran npx clear-npx-cache it asked Need to install the following packages: clear-npx-cache Ok to proceed? (y) on clicking y nothing happened so I ran

C:\react>npm install clear-npx-cache -g It showed

added 1 package, and audited 2 packages in 628ms

again Ran C:\react>npx clear-npx-cache

and then

C:\react>npm uninstall -g create-react-app

it shows up to date, audited 1 package in 278ms

at last, it let me install new version of cra after running npm install -g create-react-app I also checked it ,by creating new react app , hope my answer, helps some one

Anshu Rani
  • 21
  • 1