也许这是显而易见的,但我到处检查(除了正确的地方),谷歌它。什么都没有。
当前回答
首先,确保在环境变量路径中有以下地址
C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0
然后打开命令提示符,输入以下命令:
tsc -v
其他回答
你可以做npm list | grep typescript,如果它是通过npm安装的。
在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
....
首先,确保在环境变量路径中有以下地址
C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0
然后打开命令提示符,输入以下命令:
tsc -v
As far as I understand VS has nothing to do with TS installed by NPM. (You may notice after you install TS using NPM, there is no tsc.exe file). VS targets only tsc.exe installed by TS for VS extension, which installes TS to c:\Program Files (x86)\Microsoft SDKs\TypeScript\X.Y. You may have multiple folders under c:\Program Files (x86)\Microsoft SDKs\TypeScript. Set TypeScriptToolsVersion to the highest version installed. In my case I had folders "1.0", "1.7", "1.8", so I set TypeScriptToolsVersion = 1.8, and if you run tsc - v inside that folder you will get 1.8.3 or something, however, when u run tsc outside that folder, it will use PATH variable pointing to TS version installed by NPM, which is in my case 1.8.10. I believe TS for VS will always be a little behind the latest version of TS you install using NPM. But as far as I understand, VS doesnt know anything about TS installed by NPM, it only targets whateve versions installed by TS for VS extensions, and the version specified in TypeScriptToolsVersion in your project file.
你可以在Visual Studio 2013中的NuGet Package Manager Console中运行它。
推荐文章
- 'this'隐式具有类型'any',因为它没有类型注释
- 如何禁用诊断工具?
- 在TypeScript中声明抽象方法
- Visual Studio单击“查找结果”在错误的窗口中打开代码
- 如何强制tsc忽略node_modules文件夹?
- TypeScript for…的索引/键?
- 如何在Typescript中获得一个变量类型?
- 无法打开Visual Studio -抛出错误“安装过程中无法运行”
- 我在哪里可以找到安装在Visual Studio中的TypeScript版本?
- 在Handsontable Cells中渲染Angular组件
- 在TypeScript / Angular中什么时候使用Interface和Model
- 如何在Typescript中解析JSON字符串
- TypeScript中的extends和implements有什么区别
- Visual Studio代码如何解决合并冲突与git?
- _references.js是用来做什么的?