programming language, superset of JavaScript that compiles to JavaScript
Factsheet
Anders Hejlsberg,
Luke Hoban
Anders Hejlsberg,
Luke Hoban
Videos
» npm install typescript
A few tips in order
- restart the terminal
- restart the machine
- reinstall nodejs + then run
npm install typescript -g
If it still doesn't work run npm config get prefix to see where npm install -g is putting files (append bin to the output) and make sure that they are in the path (the node js setup does this. Maybe you forgot to tick that option).
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)
I had the same problem below procedure worked for me
Update NPM
npm install npm@latest -g
Update typescript
npm -g upgrade typescript
or
npm install typescript@latest -g
now you should see
tsc --version
Version 2.1.5
Since selected correct answer didn't help me I figured I'd share how I resolved the issue.
I had to remove C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\ from my PATH.
After that I could run this command and see the version I was expecting:
C:\>tsc --version
message TS6029: Version 1.5.3