5

I am trying to build an application in Visual Studio that uses typescript. I followed the directions here and installed the typescript compiler for the version the project requires (2.2). I did it with NPM

npm install typescript 

I verified my installation by

tsc --version

and it returned

Version 2.2.2

which is expected. However, when I go to build my solution I keep getting the following error:

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

I have tried Google-ing and haven't had any luck. Can someone point me down the road to a solution?

1 Answer 1

4

Are you on an older version of Visual Studio 2017? Make sure you are on version 15.3.

15.2 includes TypeScript 2.2, but 15.3 also allows different versions of TypeScript to be selected per project.

Once you have updated, you should be able to go to Properties/TypeScript Build for your project and ensure 2.2 is selected.

For future TypeScript updates you can install the TypeScript SDK for Visual Studio 2017.

Check https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017 for details. (The instructions you referred to are for Visual Studio Code.)

Sign up to request clarification or add additional context in comments.

1 Comment

You may also need the Microsoft.TypeScript.MSBuild nuget package, and you should select the version of the package that matches the typescript you are building.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.