我需要以这种方式启动一个特定的 .js 文件来执行:
npx app.js launch.conf.js //用于执行脚本
npx app.js debug.conf.js //用于调试脚本
在我的 debug.conf.js 中包含
const config = {
debug: true,
execArgv: ['--inspect-brk'],
maxInstances: 1,
cucumberOpts: {
timeout: 30 * 1000 * 4,
},
};
exports.config =config
Run Code Online (Sandbox Code Playgroud)
, 当我通过 CMD 执行第二个命令时,我可以使用 chromedev 工具调试器进行调试。但是当我需要使用 VS 代码编辑器进行调试时:这存在于我的 launch.json 文件中:
"type": "node",
"name": "manager",
"request": "launch",
"protocol": "auto",
// "port": 5859,
"program": "${workspaceRoot}\\node_modules\\cdem\\bin\\app",
"execArgv": ["--inspect-brk"],
"args": [
"run wdio.debug.conf.js"
]
Run Code Online (Sandbox Code Playgroud)
我一直将控制台操作设为:附加调试器,等待调试器断开连接并且未启动执行。
有人可以让我如何使用 VS Code 调试这个应用程序吗?