typescript 构建:未知编译器选项“listemittedfiles”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39782968/
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
Build:Unknown compiler option 'listemittedfiles'
提问by Emma
I get the error as below when building project after uninstalling the TypeScript 2.0. (Visual Studio 2015)
卸载 TypeScript 2.0 后构建项目时出现如下错误。(Visual Studio 2015)
tsc : error TS5023: Build:Unknown compiler option 'listemittedfiles'.
tsc:错误 TS5023:构建:未知编译器选项“listemittedfiles”。
Do you know how to fix it? Thanks,
你知道如何解决吗?谢谢,
回答by Darkseal
I had my hard times yesterday trying to fix this nasty issue: I finally found out that MSBuild was still using an old TypeScript version instead of the latest one. To fix it for good, you should do the following:
昨天我在尝试解决这个令人讨厌的问题时遇到了困难:我终于发现 MSBuild 仍在使用旧的 TypeScript 版本而不是最新版本。要永久修复它,您应该执行以下操作:
- Install the updated Visual Studio 2015 TypeScript Tools(2.0.6 at the time of writing)
- (optionally) remove the TypeScript 1.x references from your PATH environment variable and/or replace them with the new TypeScript 2.x folder path.
- 安装更新的Visual Studio 2015 TypeScript 工具(撰写本文时为 2.0.6)
- (可选)从 PATH 环境变量中删除 TypeScript 1.x 引用和/或将它们替换为新的 TypeScript 2.x 文件夹路径。
Doing this will point MSBuild to the proper TypeScript build, which fully supports the --listEmittedFiles command switch.
这样做会将 MSBuild 指向正确的 TypeScript 构建,它完全支持 --listEmittedFiles 命令开关。
For more info regarding this issue I also suggest you to read this articlethat I've written about such topic and also these two Github threads (affiliation warning: the second one being on the GitHub repo of a book I wrote):
有关此问题的更多信息,我还建议您阅读我撰写的有关此类主题的文章以及这两个 Github 线程(附属警告:第二个位于我写的一本书的 GitHub 存储库上):
回答by Emmanuel
I had the some problem. I found out, that I had a wrong (i.e. older) version of typescript installed (in addition to the current one) and even though the latest version was installed too, the old typescript compiler (tsc) was used.
我有一些问题。我发现,我安装了错误(即旧)版本的打字稿(除了当前版本),即使也安装了最新版本,但使用了旧的打字稿编译器 (tsc)。
Open a MSBuild Windows Console and run the command following command:
打开 MSBuild Windows 控制台并运行以下命令:
tsc -v
tsc -v
and see what version it gives
看看它给出了什么版本
uninstalling the old version solved the problem
卸载旧版本解决了问题
回答by Mohtisham Zubair
please check this out how to setup angular2 + typescript in VS2015 community (update 3)
请查看如何在 VS2015 社区中设置 angular2 + typescript(更新 3)
https://github.com/MohtishamZubair/AgentDistribution/wiki/Setting-up-AngularJS2-in-VS2015-in-MVC5
https://github.com/MohtishamZubair/AgentDistribution/wiki/Setting-up-AngularJS2-in-VS2015-in-MVC5
Now you don't need to run node.js server or even any command line npm commands.
现在你不需要运行 node.js 服务器,甚至不需要任何命令行 npm 命令。
回答by Arun Prasad E S
I had similar issue, cleared it
我有类似的问题,已解决
I had manually added ts.config file in the project. I removed it.
我在项目中手动添加了 ts.config 文件。我删除了它。
回答by basarat
tsc : error TS5023: Build:Unknown compiler option 'listemittedfiles'.
tsc:错误 TS5023:构建:未知编译器选项“listemittedfiles”。
Remove listemittedfiles
from your tsconfig.json
.
删除listemittedfiles
您tsconfig.json
。