构建:未知编译器选项“listemittedfiles" [英] Build:Unknown compiler option 'listemittedfiles'

查看:37
本文介绍了构建:未知编译器选项“listemittedfiles"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在卸载 TypeScript 2.0 后构建项目时收到如下错误.(Visual Studio 2015)

I get the error as below when building project after uninstalling the TypeScript 2.0. (Visual Studio 2015)

tsc:错误 TS5023:构建:未知编译器选项listemittedfiles".

tsc : error TS5023: Build:Unknown compiler option 'listemittedfiles'.

你知道怎么解决吗?谢谢,

Do you know how to fix it? Thanks,

推荐答案

昨天我很难解决这个令人讨厌的问题:我终于发现 MSBuild 仍在使用旧的 TypeScript 版本而不是最新的版本.要永久修复它,您应该执行以下操作:

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:

  • 安装更新的 Visual Studio 2015 TypeScript 工具(撰写本文时为 2.0.6)
  • (可选)从 PATH 环境变量中删除 TypeScript 1.x 引用和/或将它们替换为新的 TypeScript 2.x 文件夹路径.
  • 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.

这样做会将 MSBuild 指向正确的 TypeScript 构建,它完全支持 --listEmittedFiles 命令开关.

Doing this will point MSBuild to the proper TypeScript build, which fully supports the --listEmittedFiles command switch.

有关此问题的更多信息,我还建议您阅读这篇文章,我写过关于这样的主题以及这两个 Github 线程(附属警告:第二个在我写的一本书的 GitHub 存储库上):

For more info regarding this issue I also suggest you to read this article that 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):

这篇关于构建:未知编译器选项“listemittedfiles"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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