Maybe it's obvious, but I checked everywhere (besides the right place) and googled it. Nothing.
相关问题
- Angular RxJS mergeMap types
- void before promise syntax
- How to know full paths to DLL's from .csproj f
- Ignore Typescript errors in Webpack-dev-server
- Importing NuGet references through a local project
相关文章
- Cannot find module 'redux' 怎么解决?
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- How to get a Component's own ElementRef for re
- 'Pick' only refers to a type, but is being
- Why does `keyof any` have type of `string | number
- Visual Studio Hangs on Loading UI Library
- React testing library: Test attribute / prop
Two years after the question was asked, using Visual Studio Command Prompt still did not produce right answer for me. But the usual Help|About window seems working these days:
UPDATE (June 2017):
VS 2013 does NOT show this info. (Later note: VS 2017 Enterprise edition does not show this info either).
VS uses Microsoft Build Engine (MSBuild) to compile Typescript files. MSBuild can support several major releases of Typescript, but About window shows only the latest one.
Here is how to get to the bottom of it:
A. To check which versions of Typescript are installed with your Visual Studio/MSBuild, inspect contents of C:\Program Files (x86)\Microsoft SDKs\TypeScript folder. For example, I have versions 1.0, 1.8 and 2.2:
B. Check which version of Typescript is requested by your project. In *.csproj file, look for <TypeScriptToolsVersion> tag, or you can add it if it is missing, like this
C. Finally, you can check, which version of Typescript is actually used by MSBuild. In TOOLS | Options | Projects and Solutions | Build and Run set MSBuild project output verbosity to Detailed:
Then build your project and inspect the output: you should see the reference to one of Typescript folders described in (A).
Based in the response of basarat, I give here a little more information how to run this in Visual Studio 2013.
[UPDATE]
If you update your Visual Studio to a new version of Typescript as 1.0.x you don't see the last version here. To see the last version:
NOTE: Typescript 1.3 install in directory 1.1, for that it is important to run the command to know the last version that you have installed.
NOTE: It is possible that you have installed a version 1.3 and your code use 1.0.3. To avoid this if you have your Typescript in a separate(s) project(s) unload the project and see if the Typescript tag:
is set to 1.1.
[UPDATE 2]
TypeScript version 1.4, 1.5 .. 1.7 install in 1.4, 1.5... 1.7 directories. they are not problem to found version. if you have typescript in separate project and you migrate from a previous typescript your project continue to use the old version. to solve this:
unload the project file and change the typescript version to 1.x at:
If you installed the typescript using the visual studio installer file, the path to the new typescript compiler should be automatically updated to point to 1.x directory. If you have problem, review that you environment variable Path include
SUGGESTION TO MICROSOFT :-) Because Typescript run side by side with other version, maybe is good to have in the project properties have a combo box to select the typescript compiler (similar to select the net version)
I have VS2015 and I have to run a build with TypeScript 1.7, although I have 1.8 installed via
npm install typescript -g
there are two ways (at least for me they worked):.proj
file and add<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
as up as possible. Rebuild, re-run. If it doesn't work try 2.Control Panel -> System -> Advanced System Settings -> Enviroment Variables
. Make sure you add your desired TypeScript version first:C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.7;C:\Users\serban\AppData\Roaming\npm
This will also affect your CLI:
For a non-commandline approach, you can open the Extensions & Updates window (Tools->Extensions and Updates) and search for the Typescript for Microsoft Visual Studio extension under Installed
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.
On Visual Studio 2015 just go to: help/about Microsoft Visual Studio Then you will see something like this:
Microsoft Visual Studio Enterprise 2015 Version 14.0.24720.00 Update 1 Microsoft .NET Framework Version 4.6.01055
...
TypeScript 1.7.6.0 TypeScript for Microsoft Visual Studio
....