Problems using Ionic on my PC - cannot serve a blank project

hello, The disk on my computer was recently corrupted. I had to get it replaced. After replacing I have been having some serious problems reinstalling ionic.

after reinstalling node.js - 13.7.0

then in cmd after running

 npm install -g ionic

I get the following warning but seems to install ok.

 npm WARN deprecated superagent@4.1.0: Please note that v5.0.1+ of superagent removes User-Agent 
 header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User- 
 Agent header).  This notice will go away with v5.0.2+ once it is released.
 C:\Users\stephen\ionic -> C:\Users\stephen\node_modules\ionic\bin\ionic
 + ionic@5.4.15
 added 247 packages from 154 contributors in 18.455s

I checked the version

 ionic version

returned 5.4.15

But after running

 ionic start 

creating a blank angular project I get the following error.

 npm WARN karma-jasmine-html-reporter@1.5.1 requires a peer of jasmine-core@>=3.5 but none is 
 installed. You must install peer dependencies yourself.
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\webpack- 
 dev-server\node_modules\fsevents):npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: 
 Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: 
 {"os":"win32","arch":"x64"})
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 
 (node_modules\watchpack\node_modules\fsevents):
 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: 
 wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 
 (node_modules\karma\node_modules\fsevents):
 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: 
 wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 
  (node_modules\@angular\compiler-cli\node_modules\fsevents):
 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: 
  wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: 
  wanted 
  {  "os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

 npm ERR! code EEXIST
 npm ERR! path C:\Users\stephen\test3\node_modules\browserslist\cli.js
 npm ERR! dest C:\Users\stephen\test3\browserslist
 npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\stephen\test3\node_modules\browserslist\cli.js' 
 -> 
 'C:\Users\stephen\test3\browserslist'
 npm ERR! File exists: C:\Users\stephen\test3\browserslist
 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!     C:\Users\stephen\AppData\Roaming\npm-cache\_logs\2020-01-31T11_10_22_715Z- 
 debug.log
 [ERROR] An error occurred while running subprocess npm.

It does create the blank project, but I attempt to serve it I get the following error:

 ionic : The term 'ionic' is not recognized as the name of a cmdlet, function, script file, or operable program. 
 Check the spelling of the name, or if a 
 path was included, verify that the path is correct and try again.
 At line:1 char:1
 + ionic serve
 + ~~~~~
     + CategoryInfo          : ObjectNotFound: (ionic:String) [], CommandNotFoundException
     + FullyQualifiedErrorId : CommandNotFoundException

The only possible error I can think of is my old user drive is stored on my desktop and duplicate file paths may exist (obviously not perfect duplicates but folder names etc)

Actually I see they have upgraded to ionic 5… this must be the problem… I have a project I am already working on. How do I install ionic 4??? - - - SINCE BEEN INFORMED THIS IS NOT AN ISSUE

So the error message is complaining about an existing file. The first question I would ask myself is “did that file exist before I tried to run ionic start or not?”, and the test I would do to check that would be to make sure that the directory for the project I was planning to make does not exist before running ionic start. So can you do that? Completely remove C:\Users\stephen\test3 or move it out of the way and run ionic start again.

If the same error occurs, then something within the ionic start process is doing something unusual and further investigation is warranted. If it doesn’t, then I guess things are declared “fixed”?

The problem arose because I had ionic files saved on my desktop, pre ionic install.

I uninstalled ionic, and node.js. moved all files to a external hard drive and shutdown my pc.

Rebooted my computer, re-installed node.js and ionic.