Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Specified TypeScript compiler not found

I am using VSTS for a project that is using TypeScript. We have a CI Build configured and suddenly that one stopped working today. Yesterday all was fine, today they are all failing.

Looking into the build logs I discovered that it's not finding the TypeScript compiler that we specified:

Warning : Your project specifies TypeScriptToolsVersion 2.1, but a matching compiler was not found. The latest available TypeScript compiler will be used (2.4). To remove this warning, install the TypeScript 2.1 SDK or update the value of TypeScriptToolsVersion.

So all of a sudden it starts compiling with TypeScript 2.4 and we have some code that's not compatible with that version (Promises).

I have defined the TypeScript Tools Version in our .csproj as

<TypeScriptToolsVersion>2.1</TypeScriptToolsVersion>

and that seems to be working as I read in the build logs that it tried using that one first.

Any idea what caused VSTS suddenly to "forget" about TypeScript 2.1 and how I can fix this? I could not find any update notification or anything.

like image 802
Jules Avatar asked Jun 23 '17 15:06

Jules


People also ask

How do I install a specific version of TypeScript?

Tip: To get a specific TypeScript version, specify @version during npm install. For example, for TypeScript 3.6. 0, you would use npm install --save-dev [email protected] . To preview the next version of TypeScript, run npm install --save-dev typescript@next .

How do you check if I have TypeScript installed?

Test that the TypeScript is installed correctly by typing tsc -v into your terminal or command prompt. You should see the TypeScript version print out to the screen. For help on possible arguments you can type tsc -h or just tsc .

How do I install TypeScript globally?

You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do this, run npm install -g typescript . This will install the latest version (currently 4.8).


2 Answers

Right click on Project and click properties Click on TypeScriptBuild and Select Use Latest Available

See Image Below

like image 111
msrahate Avatar answered Sep 19 '22 14:09

msrahate


That means the TypeScript SDK has been updated on build server. If you are using private build agent, you can check it on your build server. If you are using Hosted agent, it will be updated irregularly (official article isn’t updated)

Regarding this issue, you can refer to these threads:

For VS 2015 project (Microsoft.TypeScript.MSBuild package): Visual Studio Team Services build Typescript error

For VS 2017 project (Microsoft.TypeScript.MSBuild package): Angular4.1 with .NET Core1.1 build fails in VSTS Hosted VS2017 agent

like image 45
starian chen-MSFT Avatar answered Sep 18 '22 14:09

starian chen-MSFT