programming language, superset of JavaScript that compiles to JavaScript
Factsheet
Anders Hejlsberg,
Luke Hoban
Anders Hejlsberg,
Luke Hoban
ยป npm install typescript
Videos
It took me a while to figure out the solution to this problem - it's in the original question. You need to have a script that calls tsc in your package.json file so that you can run:
npm run tsc
Include -- before you pass in options (or just include them in the script):
npm run tsc -- -v
Here's an example package.json:
{
"name": "foo",
"scripts": {
"tsc": "tsc"
},
"dependencies": {
"typescript": "^1.8.10"
}
}
As of npm 5.2.0 you no longer need an entry in the scripts section of package.json. You can now run the compiler with npx:
npx tsc
...and you don't have to update package.json with a new script every time you want to compile with different arguments.
What else do I need to do to install the latest version?
It is because you probably (almost definitely) have TypeScript plugin for visual studio installed. You can uninstall that from Control Panel. Then the typescript you installed from npm will be the default one on the command line.
Alternatively you can get the latest TypeScript from Visual Studio 2012 plugin from here : http://www.typescriptlang.org/#Download (For VS 2013 it is bundled as a part of VS 2013 update 2 RC)
Removing C:\Program Files (x86)\Microsoft SDKs\TypeScript\ from PATH environment variable did the job for me.
Advanced system settings -> Environment Variables -> system variables -> PATH