我只是想在我的 launch.json 归档 vscode ,但我得到一个错误 不允许属性参数。 下面是我的配置。
launch.json
vscode
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "index", "args": [ "src/index.ts" ], "cwd": "${workspaceFolder}" } ], "compounds": [] }
那是个愚蠢的错误。根据这个 doc
vs代码调试器通常支持在调试模式下启动程序 或者附加到调试模式下已经运行的程序。取决于 请求(附加或启动)需要不同的属性,并且 vs code的launch.json验证和建议应该有助于 那。
所以当我把请求改成 launch 从 attach ,一切都很完美。仅请求类型 发射 支持配置 args 是的。
launch
attach
发射
args
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "index", "args": [ "src/index.ts" ], "cwd": "${workspaceFolder}" } ], "compounds": [] }