Ok with help from the other thread I got it figured out.
Yes I screwed with prefix to my detriment. The reason why I kept going round and round deleting and reinstalling is I missed .npmrc in my user directory. The prefix in it was set to a path that no longer existed. I deleted my profile .npmrc and it started working again. I have now learned that is the file to edit to set prefix and cache.
Now the structure of the nodejs stock install for npm is bizarre imho. The npm executables are in the nodejs directory. Node itself is installed nodejs/node_modules/npm. The npm modules are path nodejs/node_modules/npm/node_modules.
Initially I changed my personal .npmrc to this contents
This stopped npm from installing into my appdata/roaming directory but it kept bombing because it could not create the cache directories because it was in Program Files
But I was happy because it was trying to install global into one directory instead of my profile roaming. The main reason I started this odyssey is I wanted global modules in ONE location.
So what I did was moving nodejs from program files to another directory.
change my profile .npmrc to this
changed the path entry for nodejs in paths in system properties / advanced / environmental variables / system variables / path to C:\nodejs.
I also keep deleting path in the top path in user variables but it seems to keep coming back like Freddy Krueger. Doesn’t seem to do any harm now though.
A lot of examples try to set prefix to nodejs\npm. Maybe that was kosher at one time but now the npm executable called npm is in the nodejs root directory.
Okay I am not a tech writer but I hope this will provide clues to other clueless like me. Cheers!