Visual Studio 代码 - 奇怪的是 Typescript 编译器 (tsc) 不存在

Visual Studio Code - Strangely Typescript compiler (tsc) not exists

我在按 Ctrl+Shift+B 尝试编译 Typescript 文件时遇到此错误:

(已翻译)

"tsc" is not recognized as an internal or external command...

它不应该已经包含在内???

尝试使用 npm install -g typescript 安装 tsc。

这是我的解决方案。还是有点"out of my range".

  1. 下载TypeScript for Visual Studio 2015
  2. 将安装的文件夹添加到路径示例(在我的例子中,它有效):

SET PATH=%PATH%;C:\Program Files (x86)\Microsoft SDKs\TypeScript.8\

PS:我不知道为什么,但我不得不替换 "args" 设置的第二个参数:“${workspace}”而不是“.”在 task.json