2017-04-15 67 views
1

当我按在Visual Studio代码(编译打字稿为JavaScript)我得到以下错误CMD + SHIFT + B:没有生成命令定义的错误

No build task defined. Mark a task with 'isBuildCommand' in the tasks.json file. 

我tasks.json文件看起来喜欢这个。这一直在任何其他Typescript项目中都有效。

{ 
    "version": "0.1.0", 
    "command": "tsc", 
    "isShellCommand": true, 
    "args": ["-w"], 
    "problemMatcher": "$tsc" 
} 

它不起作用,甚至当我添加'isBuildCommand'时,我仍然得到相同的错误!

{ 
    "version": "0.1.0", 
    "command": "tsc", 
    "isBuildCommand": true, 
    "args": ["-w"], 
    "problemMatcher": "$tsc" 
} 

回答

3

这是最新版VS码的一个未解决的问题。解决方法是关闭该文件夹并再次打开它。

相关问题:https://github.com/Microsoft/vscode/issues/24796

+0

自从两天前我有同样的问题。我试图建议关闭并打开文件夹...关闭和打开Visual Studio代码...卸载和安装Visual Studio代码...警告消息仍然出现...和我的打字稿文件不会被转发...这是版本1.11.2中的错误? (这是我的电脑安装的版本 - Windows 8.1) – TheSoul

相关问题