You might have an old TypeScript installation on your computer because of a Microsoft SDK:
cmd>tsc --version
Version 1.0.3.0
If you check the PATH
environment variable, you may find an entry like this:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
In my case, the uninstallation of "TypeScript Tools for Microsoft Visual Studio 2015" did not remove tsc.exe
etc. from this path, probably because it was installed as part of the Windows 10 SDK or something else.
You can remove the entry from the PATH
environment variable or at least move it below the entry for Node.js (probably C:\Program Files\nodejs
) or nvm (like C:\Users\<username>\AppData\Roaming\nvm
) in case you use Node Version Manager. This will prevent that calls to tsc
run the ancient TypeScript compiler:
cmd>tsc --version
Version 3.1.3
Don't forget to restart your command line after changes to environment variables for them to take effect!
If you are unsure what binary the tsc
command will actually run then use the where
command to find out:
cmd>where tsc
C:\Program Files\nodejs\tsc
C:\Program Files\nodejs\tsc.cmd
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
The priority is top to bottom. The first entry in my case is a (Linux) shell script and usually not executable on Windows. The second entry is a Windows Batch script and this is the one that will be executed. It basically invokes Node.js (simplified):
node.exe node_modules\typescript\bin\tsc