2017-02-14 57 views
2

这是我tasks.json文件:VS代码tasks.json错误

{ 
    "version": "0.1.0", 
    "tasks": [ 
     { 
      "taskName": "clean", 
      "windows": { 
       "command": "del" 
      }, 
      "linux": { 
       "command": "rm" 
      }, 
      "args": [ "build/*" ], 
      "showOutput": "never", 
      "isShellCommand": true, 
      "suppressTaskName": true 
     } 
    ] 
} 

我每次使用按Ctrl +Ptask clean执行任务,我得到以下错误:

Cannot read property 'args' of undefined

有人知道我失踪了吗?

回答

2

看起来直到"command"指定之外的特定OS-"linux"/"windows"性能像VSCode不满意,即使你是在这些平台之一。

随着添加的假"command": "",它的工作原理:

{ 
    "version": "0.1.0", 
    "tasks": [ 
     { 
      "taskName": "clean", 
      "windows": { 
       "command": "del" 
      }, 
      "linux": { 
       "command": "rm" 
      }, 
      "command": "", 
      "args": [ "build/*" ], 
      "showOutput": "never", 
      "isShellCommand": true, 
      "suppressTaskName": true 
     } 
    ] 
} 

这似乎是我的错误。我建议你报告给VSCode issue tracker