Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015: "tsc.exe" exited with code 1

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

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

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

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

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?!

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

like image 762
Vern Jensen Avatar asked Sep 29 '16 22:09

Vern Jensen


2 Answers

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)

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.

like image 116
Darkseal Avatar answered Nov 20 '22 13:11

Darkseal


I am using visual studio 2013. In my case in Web.csproj file, I replaced

enter image description here

by

enter image description here

I do not get this error now anymore.

like image 31
Sagar Dev Timilsina Avatar answered Nov 20 '22 11:11

Sagar Dev Timilsina