20

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

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

Do you know how to fix it? Thanks,

Emma
  • 955
  • 2
  • 8
  • 23
  • Please have a look at the `TypeScriptToolsVersion` tag in the project file (e.g.: `.csproj`). Which Version is shown there? – Philipp Sep 30 '16 at 04:24
  • I've checked *.csproj, and it has no TypeScriptToolsVersion tag inside. – Emma Sep 30 '16 at 04:35
  • Can you try to add if for test purposes? `1.8` (There might be some default value in the `Microsoft.TypeScript.targets` or something alone those lines) – Philipp Sep 30 '16 at 05:09

5 Answers5

28

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:

  • 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.

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

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):

Darkseal
  • 9,205
  • 8
  • 78
  • 111
1

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.

Open a MSBuild Windows Console and run the command following command:

tsc -v

and see what version it gives

uninstalling the old version solved the problem

Emmanuel
  • 7,574
  • 3
  • 24
  • 22
0

please check this out how to setup angular2 + typescript in VS2015 community (update 3)

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.

Mohtisham Zubair
  • 723
  • 5
  • 15
  • A link to a potential solution is always welcome, but please [add context around the link](http://meta.stackoverflow.com/a/8259/169503) so your fellow users will have some idea what it is and why it's there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. Take into account that being _barely more than a link to an external site_ is a possible reason as to [Why and how are some answers deleted?](http://stackoverflow.com/help/deleted-answers) – Ingo Karkat Jan 09 '17 at 16:48
0

I had similar issue, cleared it

I had manually added ts.config file in the project. I removed it.

Arun Prasad E S
  • 9,489
  • 8
  • 74
  • 87
-3

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

Remove listemittedfiles from your tsconfig.json.

basarat
  • 261,912
  • 58
  • 460
  • 511
  • 1
    i'm running into the same error. The only fact is that I don't have an tsconfig.json in my solution – Rob Oct 03 '16 at 07:31
  • I had the same problem, maybe my solution helps you too. Have a look at: http://stackoverflow.com/questions/40238811/how-to-solve-buildunknown-compiler-option-listemittedfiles-on-visual-studi/40358841#40358841 – samwise Nov 02 '16 at 09:14