没有发现打印稿编译器在C:\Program Files (x86)\Microsoft sdk \ \ 1.8 \ tsc.exe手稿

时间:2022-05-28 15:04:04

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:

我为Visual Studio 2015安装了Visual Studio 2015和TypeScript 1.8.6。在创建了一个新的打字稿项目和构建之后,我得到了这个构建错误:

No compiler was found at C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe

没有发现编译器在C:\Program Files (x86)\Microsoft sdk \ \ 1.8 \ tsc.exe手稿

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

事实上,tsc。exe在文件系统中丢失。

Things I've tried:

我试过的东西:

  • Uninstall and re-install TypeScript Tools for Visual Studio 2015 1.8.6.0
  • 为Visual Studio 2015 .8.6.0卸载并重新安装打字稿工具
  • Uninstall and re-install TypeScript Tools for Visual Studio 2013 1.8.5.0
  • 为Visual Studio 2013 1.8.5.0卸载并重新安装打字稿工具
  • Repair TypeScript Tools for Visual Studio 2015 1.8.6.0
  • 为Visual Studio 2015 1.8.6.0修复TypeScript工具。
  • I HAVE tried turning it off and on again :-)
  • 我已经试着把它关了又开:

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

有什么解决办法吗?哪个组件安装TypeScript SDK?

3 个解决方案

#1


2  

MSBuild is looking in the wrong place for tsc.exe

MSBuild在错误的地方寻找tsc.exe

It should be looking in 'C:\Program Files (x86)\Microsoft SDKs\TypeScript\ tsc version \tsc.exe'

它应该在'C:\Program Files (x86)\Microsoft SDKs\打印稿tsc version \tsc.exe'中查找。

e.g. C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe

例如C:\Program Files (x86)\Microsoft sdk \ \ 1.8 \ tsc.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.

打字稿SDK安装程序不会做的一件事是升级现有的项目。所以重新安装不会改变任何东西。但是,如果您希望MSBuild使用更新的编译器,您可以自己升级您的项目。

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

我认为没有任何方法可以通过UI来实现这一点,但是编辑项目文件已经足够简单了。它需要在第一个PropertyGroup中包含这个

<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>

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

如果希望构建使用v1.8.6,则需要设置。

<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>

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

就你而言,我打赌它根本不存在。所以你应该把它加起来。

#2


1  

I'm not experienced with using the TypeScript tools for Microsoft.. what you could do is use Gulp or Grunt tasks to compile TypeScript, this will even allow you to compile the TypeScript files everytime your save your .ts files.

我没有使用微软的打字稿工具的经验。您可以使用Gulp或Grunt任务来编译打字稿,这甚至允许您在每次保存.ts文件时编译打字稿文件。

You will need NPM (Node Package Manager) to install Gulp or Grunt and then install the package for compiling TypeScript.

您将需要NPM(节点包管理器)来安装Gulp或Grunt,然后安装用于编译TypeScript的包。

You can find some information about the Grunt TypeScript package here: https://www.npmjs.com/package/grunt-typescript

您可以在这里找到一些关于繁重的打字稿包的信息:https://www.npmjs.com/package/grunt-typescript

Or for information about the Gulp TypeScript package, check this: https://www.npmjs.com/package/gulp-typescript

或者是关于Gulp TypeScript包的信息,请查看:https://www.npmjs.com/package/gulp-typescript。

#3


1  

I've read through the comments on this issue on the TypeScript Github repo. Although this is a different issue, I did find a clue: repairing Visual Studio 2015 (through the Control Panel) installed tsc.exe in the correct folder.

我已经阅读了关于这个问题的打字稿Github repo上的评论。虽然这是一个不同的问题,但是我找到了一个线索:修复Visual Studio 2015(通过控制面板)安装了tsc。exe在正确的文件夹中。

#1


2  

MSBuild is looking in the wrong place for tsc.exe

MSBuild在错误的地方寻找tsc.exe

It should be looking in 'C:\Program Files (x86)\Microsoft SDKs\TypeScript\ tsc version \tsc.exe'

它应该在'C:\Program Files (x86)\Microsoft SDKs\打印稿tsc version \tsc.exe'中查找。

e.g. C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe

例如C:\Program Files (x86)\Microsoft sdk \ \ 1.8 \ tsc.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.

打字稿SDK安装程序不会做的一件事是升级现有的项目。所以重新安装不会改变任何东西。但是,如果您希望MSBuild使用更新的编译器,您可以自己升级您的项目。

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

我认为没有任何方法可以通过UI来实现这一点,但是编辑项目文件已经足够简单了。它需要在第一个PropertyGroup中包含这个

<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>

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

如果希望构建使用v1.8.6,则需要设置。

<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>

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

就你而言,我打赌它根本不存在。所以你应该把它加起来。

#2


1  

I'm not experienced with using the TypeScript tools for Microsoft.. what you could do is use Gulp or Grunt tasks to compile TypeScript, this will even allow you to compile the TypeScript files everytime your save your .ts files.

我没有使用微软的打字稿工具的经验。您可以使用Gulp或Grunt任务来编译打字稿,这甚至允许您在每次保存.ts文件时编译打字稿文件。

You will need NPM (Node Package Manager) to install Gulp or Grunt and then install the package for compiling TypeScript.

您将需要NPM(节点包管理器)来安装Gulp或Grunt,然后安装用于编译TypeScript的包。

You can find some information about the Grunt TypeScript package here: https://www.npmjs.com/package/grunt-typescript

您可以在这里找到一些关于繁重的打字稿包的信息:https://www.npmjs.com/package/grunt-typescript

Or for information about the Gulp TypeScript package, check this: https://www.npmjs.com/package/gulp-typescript

或者是关于Gulp TypeScript包的信息,请查看:https://www.npmjs.com/package/gulp-typescript。

#3


1  

I've read through the comments on this issue on the TypeScript Github repo. Although this is a different issue, I did find a clue: repairing Visual Studio 2015 (through the Control Panel) installed tsc.exe in the correct folder.

我已经阅读了关于这个问题的打字稿Github repo上的评论。虽然这是一个不同的问题,但是我找到了一个线索:修复Visual Studio 2015(通过控制面板)安装了tsc。exe在正确的文件夹中。