【发布时间】:2018-07-08 20:46:44
【问题描述】:
我正在按照microsoft docs 的演练在 vs 代码项目中使用 typescript。当我尝试运行构建任务时,终端会出现
执行任务:c:\whatever\my path with spaces\Projects\ProjectName\node_modules.bin\tsc.cmd -p "c:\whatever\my path with spaces\Projects\ProjectName\tsconfig.json"
和错误
'c:\whatever\my' 未被识别为内部或外部命令,
也就是说,文件夹名称中的空格使任务运行者感到困惑。我需要类似的东西
call "c:\whatever\my path with spaces\Projects\ProjectName\node_modules\.bin\tsc.cmd" -p "c:\whatever\my path with spaces\Projects\ProjectName\tsconfig.json"
如何设置 VS Code 以便终端接收可以用目录名称中的空格解释的输入?谢谢
当前任务.json:
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
【问题讨论】:
-
也许你需要像superuser.com/questions/279008/…这样的空间转义