Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

visual studio - No TypeScript compiler was found at C:Program Files (x86)Microsoft SDKsTypeScript1.8 sc.exe

I installed Visual Studio 2015 and TypeScript 1.8.6 for Visual Studio 2015. After creating a new TypeScript project and building, I get this build error:

No compiler was found at C:Program Files (x86)Microsoft SDKsTypeScript1.8sc.exe

Indeed, tsc.exe is missing in the file system.

Things I've tried:

  • Uninstall and re-install TypeScript Tools for Visual Studio 2015 1.8.6.0
  • Uninstall and re-install TypeScript Tools for Visual Studio 2013 1.8.5.0
  • Repair TypeScript Tools for Visual Studio 2015 1.8.6.0
  • I HAVE tried turning it off and on again :-)

Any clue on how to solve this? Which component installs the TypeScript SDK?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

MSBuild is looking in the wrong place for tsc.exe

It should be looking in 'C:Program Files (x86)Microsoft SDKsTypeScript tsc version sc.exe'

e.g. C:Program Files (x86)Microsoft SDKsTypeScript1.8sc.exe

The one thing the TypeScript SDK installer wont do, is upgrade your existing projects. So all that reinstalling wont change anything. However, if you want MSBuild to use the newer compiler, you can upgrade your project yourself.

I don't think there is any way to do this through the UI, but it's easy enough to edit the Project file. It needs to contain this in the first PropertyGroup

<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>

If you want the build to use v1.8.6, you need to set

<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>

In your case, I'm betting it's not there at all. So you should just add it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...