Visual Studio 2015:“tsc.exe"退出代码 1 [英] Visual Studio 2015: "tsc.exe" exited with code 1

查看:42
本文介绍了Visual Studio 2015:“tsc.exe"退出代码 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前将 Visual Studio 2013 用于 Web TypeScript 项目.升级到 Visual Studio 2015 Update 3,在构建项目时,我得到

I was formerly using Visual Studio 2013 for a web TypeScript project. Upgraded to Visual Studio 2015 Update 3, and when building the project, I get

"tsc.exe" exited with code 1

网络上有一百万个这样的错误.有人建议我通过 NPM 安装 Microsoft.TypeScript.MSBuild 和 Microsoft.TypeScript.Compiler,我做到了.

There are a million of these errors on the web. One suggested I install Microsoft.TypeScript.MSBuild and Microsoft.TypeScript.Compiler via NPM, which I did.

当我深入研究输出(使其变得冗长)时,我看到:

When I dig into the Output (making it verbose), I see this:

1>  C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.6\tsc.exe --project "F:\depot\depot\code\main\web\CedarsReport\tsconfig.json" --listEmittedFiles
1>  F:\depot\depot\code\main\web\CedarsReport\error TS5023:Build:Unknown compiler option 'listemittedfiles'.

问题:1) 为什么使用 TypeScript 1.6?我为 Visual Studio 2015 安装了TypeScript 1.8.4".

Questions: 1) Why is it using TypeScript 1.6? I installed "TypeScript 1.8.4 for Visual Studio 2015."

2) --listEmittedFiles 选项从何而来,我该如何禁用它?

2) Where is the --listEmittedFiles option coming from, and how can I disable it?

3) 如果我去 Project > Properties > TypeScript Build,它会说::检测到一个或多个 tsconfig.json 文件.项目属性被禁用."所以我尝试将我的 tsconfig.json 文件移动到桌面,删除项目文件夹中的那个.退出 Visual Studio 2015 并重新启动,清理并重建,以及相同的错误消息.为什么tsconfig.json文件没有了,还以为还有?!

3) If I go to Project > Properties > TypeScript Build, it says: ":One or more tsconfig.json files detected. Project properties are disabled." So I tried moving my tsconfig.json file to the desktop, deleting the one in the project folder. Quit Visual Studio 2015 and restarted, did clean and rebuild, and same error message. Why does it think there is still a tsconfig.json file when there isn't one?!

即使您不能回答所有问题,也欢迎您回答任何问题,尤其是.#2.

Even if you can't answer all questions, answering any would be welcome, esp. #2.

推荐答案

您或许可以通过使用以下链接安装 TypeScript 2.1.5 来解决此问题:

You can probably fix this issue by installing TypeScript 2.1.5 using the following link:

  • Visual Studio 2015 TypeScript Tools (2.1.5 at the time of writing)

这也会将 MSBuild 指向正确的 TypeScript 构建,它完全支持 --listEmittedFiles 命令开关(1.x 不支持,因此出现错误).

This will also point MSBuild to the proper TypeScript build, which fully supports the --listEmittedFiles command switch (not supported in 1.x, hence the error).

另见这个答案和/或这篇文章,我写的关于这个主题的更多细节和参考.

See also this answer and/or this article that I wrote on the topic for further details and references about this issue.

这篇关于Visual Studio 2015:“tsc.exe"退出代码 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆