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:00

If you only have TypeScript installed for Visual Studio then:

  1. Start the Visual Studio Command Prompt
  2. Type tsc -v and hit Enter

Visual Studio 2017 versions 15.3 and above bind the TypeScript version to individual projects, as this answer points out:

  1. Right click on the project node in Solution Explorer
  2. Click Properties
  3. Go to the TypeScript Build tab
查看更多
Deceive 欺骗
3楼-- · 2019-01-16 10:01

The tsc -v command run technically reads the TypeScript compiler version within the SDK directory set within the Windows Path variable. This doesn't necessarily reflect the latest version installed as the Path variable is not updated with subsequent installations.

The version that VS.NET uses to compile the TypeScript is what's in the project's configuration:

<TypeScriptToolsVersion>1.5</TypeScriptToolsVersion>

To help explain this more in detail I created the following post which has the specifics on the TypeScript versions installed, and which version VS.NET uses to compile the TypeScript files.

Which Version of TypeScript is Installed and Which Version is Visual Studio Using?

I also added a feature request on Microsoft Connect to make viewing and switching the TypeScript targeted version in VS.NET easier. This isn't really a TypeScript feature request as much as it is a VS.NET IDE enhancement.

Allow switching TypeScript configured version from Project Properties IDE

查看更多
Animai°情兽
4楼-- · 2019-01-16 10:05

In the command prompt, simply type 1 of the following command then hit Enter :

  • tsc -v

    or

  • tsc -version

    or

  • tsc --version
查看更多
Bombasti
5楼-- · 2019-01-16 10:06

You can run it in NuGet Package Manager Console in Visual Studio 2013.

查看更多
老娘就宠你
6楼-- · 2019-01-16 10:14

The TypeScript team sorted this out in Visual Studio 2017 versions 15.3 and later, including the free Community edition.

How to See Which TypeScript Versions are Installed in Visual Studio

All you now need do is to go to project properties of any TypeScript Visual Studio project (right-click the project file in Solution Explorer/Properties), then go to the TypeScript Build tab on the left-hand side. This has a 'Typescript version' dropdown that shows you the version the project is using, and if you open it the dropdown shows you ALL versions of TypeScript currently installed in Visual Studio.

The actual installs are currently at C:\Program Files (x86)\Microsoft SDKs\TypeScript and then subfolders by version number, at least on Win10 on my computer. If you want to see the exact version (e.g. 2.8.3 rather than just 2.8) you can find the appropriate tsc.exe in here and look at its properties (Details tab in right-click/Properties in File Explorer).

How to Install Specific TypeScript Version

If you want to install a specific version of TypeScript for Visual Studio, you can download older versions from the Details->Releases section of the TypeScript SDK for Visual Studio 2017 Downloads page. You can verify that the version has been installed either with the 'Typescript version' dropdown in VS or inspecting the C:\Program Files (x86)\Microsoft SDKs\TypeScript folder.

查看更多
姐就是有狂的资本
7楼-- · 2019-01-16 10:15

First, make sure you have the following address in your Environment Variables Path

C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0

Then open your Command Prompt and type the following command:

tsc -v
查看更多
登录 后发表回答