'Issues with uninstalling create-react-app

I am running npm uninstall create-react-app, and it returns

npm WARN saveError ENOENT: no such file or directory, open '/Users/me/Documents/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/me/Documents/package.json'
npm WARN Documents No description
npm WARN Documents No repository field.
npm WARN Documents No README data
npm WARN Documents No license field.

I want to update my create-react-app version, and apparently they no longer support global installs. When I installed CRA the first time (a while ago), it was installed globally. Now, I am trying to update it, and I'm running into issues. I ran npm update create-react-app, however my terminal just blinks for a second and returns to the prompt. I, therefore, decided to uninstall create-react-app altogether and reinstall it, however now I'm running into the above warnings/issues.

Any thoughts on what may be going on?

Edit:

When I run npm i create-react-app, it also throws the above WARNs, but it also says

+ [email protected] // <---
added 1 package and audited 578 packages in 1.787s

However, when I run the command create-react-app --version again, it says 3.2.0

Edit 2:

I've ran npm i -g create-react-app several times, but that throws:

Michaels-MacBook-Pro:Documents me$ npm i -g create-react-app
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/create-react-app/index.js
npm ERR! dest /usr/local/bin/create-react-app
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'
npm ERR! File exists: /usr/local/bin/create-react-app
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2019-12-23T08_07_29_158Z-debug.log



Solution 1:[1]

After globally uninstalling create-react-app, I was still getting an error that my create-react-app was out of date. Here's what solved that for me:

After

sudo npm uninstall -g create-react-app

Run

npx clear-npx-cache

Then try reinstalling create-react-app in the proper working directory:

npx create-react-app my-app

Solution 2:[2]

To uninstall it completely try running

sudo npm uninstall -g create-react-app

some times this command may not remove the package completely. if so just check the directory where its located by

which create-react-app

and it will give you some directory like /usr/local/bin/create-react-app. just remove it manually by

rm -rf /usr/local/bin/create-react-app

now you can install create-react-app by

npm install -g create-react-app

but however, it is not recommended to install it globally from v3.3.0.so just use

npx create-react-app <project_name>

Solution 3:[3]

Just install over it by rerunning this command. sudo npm i -g create-react-app

I personally use NCU (https://www.npmjs.com/package/npm-check-updates) to update all my node stuff. It works globally and per project.

Solution 4:[4]

Going further with Windows 10

While Dhruv's answer solved this problem for me (finding and deleting create-react-app and then reinstalling), I still had a few problems finding create-react-app in my Windows 10 system.

I was trying to find my global install, (where create-react-app produced no results for me) and, as far as I could tell, it was never installed. But using an elevated cmd prompt by using the Win + X keys, selecting "Windows PowerShell (Admin)" and then navigating to my desired working directory, I could then execute npx create-react-app my-test-app and it created a working react directory.

It seems in Windows 10, elevated cmd prompt is the way forward for using npx create-react-app my-test-app successfully. I am not sure why this is though. As previously it was working (at least for me) with the normal cmd prompt.

Solution 5:[5]

For windows

tried npm uninstall -g create-react-app that didn't work for me.

I did the following and it worked:

  1. Elevated cmd prompt: where create-react-app it was somewhere in the system files under yarn. follow that path and delete both the files.
  2. Go to the working directory, in my case a folder inside documents. run npx create-react-app my-test-app

This will create a new folder called my-test-app and you can follow the rest of the instructions on the react app website.

cd into that new folder, run yarn start

Solution 6:[6]

For windows 10 users go to C:\Users\[username]\AppData\Roaming\npm then delete the create-react-app files

Solution 7:[7]

I was also facing the same issue. Tried many solutions but no success.

At last, I was came to a video on youtube that helped me to overcome this issue.

Link to this video is create-react-app error

The command I used is

npm uninstall -g create-react-app ; npm i -g npm@latest ; npm cache clean -f

NOTE: Depending on your node version, you might need to use && at the place of ;

Solution 8:[8]

if you are a windows user like me, you can install the Bash terminal. You will be able to execute almost all the commands used in ubuntu, except the "Sudo" command. And given commands of uninstalling and others will also work! Happy to help.

Solution 9:[9]

My issue was the lack of the word template.

Only the below issue command worked for me:

npx create-react-app my-app --template typescript

More here

Solution 10:[10]

For people who get the message to remove any global installs even after running npm uninstall -g create-react-app, and clear cache doesn't work, I found installing globally, then uninstalling globally helped me. So:

npm install -g create-react-app
npm uninstall -g create-react-app

I run the npx clear-npx-cache just in case, and it worked. I guess the new installation overwrote the leftover files that couldn't be cleaned. Also, I should mention, I used Windows 10 and also PowerShell with Admin privileges; I'm not sure if Admin is needed.

Solution 11:[11]

Windows solution:

1- uninstall globally npm uninstall -g create-react-app

2- use where create-react-appon terminal and remove all path founded!

3- create new react app npx create-react-app client --template typescript