Error (3): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)

I have been having a terrible time installing Flutter and Dart on Windows 10. No matter what I do I get the Unable to ‘pub upgrade’ flutter tool error when running flutter doctor.

I searched the web for answers and I have tried everything.

I have plenty of diskspace. I turned off my virus checker. I don’t live in China. I set the environment variable path properly on both the owner and even the system environmental variable when the owner didn’t work. I deleted the cache folder. I tried running flutter doctor from both the cmd prompt and powershell (which I have the latest version of) as an administrator and not as an administrator. I even tried to cd to the flutter directory that my path variable points to and still nothing works.

The only thing that I haven’t tried is to install flutter on a different laptop.

What follows is a copy of the error message.

C:\WINDOWS\system32>flutter doctor
Building flutter tool…
Running pub upgrade…
The system cannot find the path specified.
Error (3): Unable to ‘pub upgrade’ flutter tool. Retrying in five seconds… (9 tries left)

Waiting for 3 seconds, press CTRL+C to quit …
Terminate batch job (Y/N)? Y

I am not a window guy and I am new to flutter. Any help would be much appreciated.

Thanks

P.S. When I initially wrote this post I saw that there were similar posts, but when I tried to search for pub upgrade, I didn’t see those posts.