2017-02-14 52 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