How to Resolve the 'Error MSB6006 tsc.exe exited with code 2' build error in Visual Studio 2015

How to Resolve the 'Error MSB6006 tsc.exe exited with code 2' build error in Visual Studio 2015

After long pause I returned back to my pet project, but suddenly build started to fail with error Error MSB6006 tsc.exe exited with code 2.
The error is quite ambiguous. Answers on stack overflow didn’t help much.
But I was able to find what was the issue. I needed more details: what was the exact issue why TypeScript compiler failed?
To find out that I changed build verbosity to detailed:
In Visual Studio, open Tools->Options, there go to Projects and Solutions->Build and Run, and select Detailed in the MSBuild project build output verbosity:

Run the build again and open output tab. Then it is just a matter of finding the place with detailed error message and addressing it.


There may be multiple reasons why build fails. In my case detailed error was:

1>       Task "VsTsc"
1>         C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "C:\Users\vitalii\Source\Repos\BenchmarkLab\src\BenchmarkLab\wwwroot\lib\hydrolysis\tsconfig.json"
1>         Unknown output: Cannot open file 'C:\Users\vitalii\Source\Repos\BenchmarkLab\src\BenchmarkLab\wwwroot\lib\hydrolysis\typings\main.d.ts'.
1>         C:\Users\vitalii\Source\Repos\BenchmarkLab\src\BenchmarkLab\error TS6053:Build:File 'C:/Users/vitalii/Source/Repos/BenchmarkLab/src/BenchmarkLab/wwwroot/lib/hydrolysis/typings/main.d.ts' not found.
1>     1>
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(214,5): error MSB6006: "tsc.exe" exited with code 2.
1>       Done executing task "VsTsc" -- FAILED.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值