也许这是显而易见的,但我到处检查(除了正确的地方),谷歌它。什么都没有。
当前回答
TypeScript团队在Visual Studio 2017版本15.3及更高版本中整理了这个问题,包括免费的社区版。
如何查看Visual Studio中安装了哪些TypeScript版本
现在你所需要做的就是转到任何TypeScript Visual Studio项目的项目属性(在解决方案资源管理器/属性中右键单击项目文件),然后转到左侧的TypeScript Build选项卡。它有一个“Typescript version”下拉菜单,显示项目正在使用的版本,如果你打开它,下拉菜单会显示当前安装在Visual Studio中的所有版本的Typescript。
目前实际安装在C:\Program Files (x86)\Microsoft SDKs\TypeScript,然后是按版本号的子文件夹,至少在我电脑上的Win10上是这样。如果你想看到确切的版本(例如2.8.3而不仅仅是2.8),你可以在这里找到适当的tsc.exe,并查看它的属性(在文件资源管理器中右键单击/属性中的详细信息选项卡)。
如何安装特定的TypeScript版本
If you want to install a specific version of TypeScript then these can be found on Visual Studio Marketplace, although specific version numbers can be a little difficult to find in that list. A Google search for, for example, 'visual studio marketplace typescript 3.3.1' will usually find the exact version you want. If you install from here and restart Visual Studio the version will appear in the dropdown. Note also that some of the latest versions of TypeScript (e.g. 4.2) will refuse to install if there's a more recent version installed.
Node.js控制台应用程序
这个答案不适用于“Node.js控制台应用程序”项目类型,该项目属性中没有TypeScript Build选项卡。这是因为它使用了一个使用npm安装在项目文件夹中的TypeScript版本。版本可以在包中查看和更改。json文件,安装时出现在解决方案资源管理器的npm条目下,以及磁盘上的node_modules/typescript文件夹中。
其他回答
你可以在Visual Studio 2013中的NuGet Package Manager Console中运行它。
在Visual Studio 2015上,只需访问:help/about Microsoft Visual Studio 然后你会看到这样的东西:
微软Visual Studio企业2015 版本14.0.24720.00更新1 微软。net框架 版本4.6.01055
...
打印稿1.7.6.0 TypeScript for Microsoft Visual Studio
....
在命令提示符中,只需输入以下命令的1,然后按Enter:
tsc - v 或 tsc - version 或 tsc -版本
注意:请确保已将Typescript添加到环境变量path中 执行命令前,请先查看:如何设置环境 变量。
如果你想知道在一个特定的项目中使用了什么版本的Typescript,去你的package-lock。json文件。你会发现这样的东西:
"typescript": {
"version": "3.5.3"
}
TypeScript团队在Visual Studio 2017版本15.3及更高版本中整理了这个问题,包括免费的社区版。
如何查看Visual Studio中安装了哪些TypeScript版本
现在你所需要做的就是转到任何TypeScript Visual Studio项目的项目属性(在解决方案资源管理器/属性中右键单击项目文件),然后转到左侧的TypeScript Build选项卡。它有一个“Typescript version”下拉菜单,显示项目正在使用的版本,如果你打开它,下拉菜单会显示当前安装在Visual Studio中的所有版本的Typescript。
目前实际安装在C:\Program Files (x86)\Microsoft SDKs\TypeScript,然后是按版本号的子文件夹,至少在我电脑上的Win10上是这样。如果你想看到确切的版本(例如2.8.3而不仅仅是2.8),你可以在这里找到适当的tsc.exe,并查看它的属性(在文件资源管理器中右键单击/属性中的详细信息选项卡)。
如何安装特定的TypeScript版本
If you want to install a specific version of TypeScript then these can be found on Visual Studio Marketplace, although specific version numbers can be a little difficult to find in that list. A Google search for, for example, 'visual studio marketplace typescript 3.3.1' will usually find the exact version you want. If you install from here and restart Visual Studio the version will appear in the dropdown. Note also that some of the latest versions of TypeScript (e.g. 4.2) will refuse to install if there's a more recent version installed.
Node.js控制台应用程序
这个答案不适用于“Node.js控制台应用程序”项目类型,该项目属性中没有TypeScript Build选项卡。这是因为它使用了一个使用npm安装在项目文件夹中的TypeScript版本。版本可以在包中查看和更改。json文件,安装时出现在解决方案资源管理器的npm条目下,以及磁盘上的node_modules/typescript文件夹中。
推荐文章
- 如何为构造函数定制Visual Studio的私有字段生成快捷方式?
- 从元组/数组值派生联合类型
- 如何在Angular2 ngSwitch语句中使用typescript enum值
- 为什么Visual Studio 2015/2017/2019测试运行器没有发现我的xUnit v2测试
- Visual Studio复制项目
- 找到合成属性@panelState。请在您的应用程序中包含“BrowserAnimationsModule”或“NoopAnimationsModule”。
- Angular 2+和debounce
- 如何在iis7应用程序池中设置。net Framework 4.5版本
- 在TypeScript箭头函数中指定返回类型
- 如何使用jQuery与TypeScript
- Angular 2模板中的标签是什么意思?
- Typescript接口-可能使“一个或另一个”属性要求?
- 如何扩展/继承组件?
- Visual Studio - Resx文件默认“内部”为“公共”
- 在Visual Studio 2010中有快速查找文件的方法吗?