Where can I find the TypeScript version installed

2019-01-16 09:23发布

Maybe it's obvious, but I checked everywhere (besides the right place) and googled it. Nothing.

14条回答
一夜七次
2楼-- · 2019-01-16 10:16

Open a (normal, not the VS) command prompt or a PowerShell prompt.

tsc.exe -v tsc.cmd -v tsc -v

If you installed the same version of TypeScript for Visual Studio and using npm, the output from the above three commands should be the same.

If not, check your System PATH to see where in the path hierarchy and which typescript directory is listed. For PowerShell users, the easy way is: $env:path -split ';'

Be careful of having nothing or multiple TypeScript directories listed in your System PATH variable. As of June 9, 2017, my System PATH looked like this (just the top part, which is all that matters in this situation): ps>$env:path -split ';' C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0\ C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.3 C:\nodejs\ C:\Users\{username}\AppData\Roaming\npm

Notice that only the 2.3 directory is included in the PATH, not multiple versions.

查看更多
别忘想泡老子
3楼-- · 2019-01-16 10:19

You can do npm list | grep typescript if it's installed through npm.

查看更多
登录 后发表回答