You are all messing with the global installations and -path files. Just a little error might damage every project you have ever written, and you will spend the rest of the night trying to get a console.log('hi')
to work again.
If you have run npm i typescript --save-dev
in your project - just try to run:
npx tsc
And see if it works before messing with global stuff (unless of course you really know what you are doing)