Gulp手表任务跑步者错误。它导致Windows脚本主机错误。
我已经尝试更改文件task.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"command": "gulp",
"isShellCommand": true,
"args": [
"--no-color"
],
"tasks": [
{
"taskName": "scripts",
"isBuildCommand": true,
"showOutput": "always"
},
{
"taskName": "sass",
"isBuildCommand": true,
"showOutput": "always"
},
{
"taskName": "watch",
"isBuildCommand": true,
"showOutput": "always"
}
]
}
看起来您使用的是较旧的语法。我不相信taskname
不再受支持了。
这是我使用的tasks.json文件,两种调用gulp命令的方法都有效。 (你提到task.json
,我认为这是一个错字,它是tasks.json
)
{
"version": "2.0.0",
"tasks": [
{
"label": "Start server and process files",
"command": "gulp",
"args": [
"sync"
],
"type": "shell",
"options": {
"cwd": "${workspaceRoot}"
}
},
{
"label": "Gulp: Start server only",
"type": "gulp",
"task": "serve",
"problemMatcher": []
},
{
"label": "Gulp: watch",
"type": "gulp",
"task": "watch",
"problemMatcher": []
}
}
看起来你也想要:
"group": "build",
在您的每个任务中 - 替换您在上面使用的isBuildCommand
语法。
和:
"presentation": {
"reveal": "always",
},
而不是showoutput
语法。