【发布时间】:2018-01-04 07:01:52
【问题描述】:
我在 OSX 上安装了一个最小的 Electron 应用程序,通过命令行运行时可以正常工作,但我无法使用 Visual Studio Code 在调试模式下运行:
Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:13207).
我的 launch.json 文件如下所示:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/main.js",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"runtimeArgs": [
".",
"--enable-logging"
],
"env": {},
"console": "internalConsole",
"sourceMaps": false
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]
}
任何帮助将不胜感激。
【问题讨论】:
-
添加 "protocol": "legacy" 到配置
标签: node.js visual-studio-code electron