typescript Visual Studio 2015:“tsc.exe”退出,代码为 1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39781115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2015: "tsc.exe" exited with code 1
提问by Vern Jensen
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
我以前在 Web TypeScript 项目中使用 Visual Studio 2013。升级到 Visual Studio 2015 Update 3,在构建项目时,我得到
"tsc.exe" exited with code 1
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.
网络上有一百万个这样的错误。有人建议我通过 NPM 安装 Microsoft.TypeScript.MSBuild 和 Microsoft.TypeScript.Compiler,我做到了。
When I dig into the Output (making it verbose), I see this:
当我深入研究输出(使其变得冗长)时,我看到:
1> C:\Program Files (x86)\Microsoft SDKs\TypeScript.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'.
Questions: 1) Why is it using TypeScript 1.6? I installed "TypeScript 1.8.4 for Visual Studio 2015."
问题:1)为什么使用 TypeScript 1.6?我安装了“TypeScript 1.8.4 for Visual Studio 2015”。
2) Where is the --listEmittedFiles option coming from, and how can I disable it?
2) --listEmittedFiles 选项来自哪里,如何禁用它?
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?!
3) 如果我转到项目 > 属性 > TypeScript Build,它会说:“:检测到一个或多个 tsconfig.json 文件。项目属性被禁用。” 所以我尝试将我的 tsconfig.json 文件移动到桌面,删除项目文件夹中的那个。退出 Visual Studio 2015 并重新启动,清理并重建,以及相同的错误消息。为什么在没有tsconfig.json文件的情况下它会认为还有一个?!
Even if you can't answer all questions, answering any would be welcome, esp. #2.
即使您不能回答所有问题,也欢迎回答任何问题,尤其是。#2.
回答by Darkseal
You can probably fix this issue by installing TypeScript 2.1.5using the following link:
您可以通过使用以下链接安装TypeScript 2.1.5来解决此问题:
- Visual Studio 2015 TypeScript Tools(2.1.5 at the time of writing)
- Visual Studio 2015 TypeScript 工具(撰写本文时为 2.1.5)
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).
这也会将 MSBuild 指向正确的 TypeScript 构建,它完全支持--listEmittedFiles
命令开关(1.x 中不支持,因此出现错误)。
See also this answerand/or this articlethat I wrote on the topic for further details and references about this issue.