【问题标题】:Electron/VSCode : Cannot connect to runtime process, timeout after 10000 ms - (ECONNREFUSED)Electron/VSCode:无法连接到运行时进程,10000 毫秒后超时 - (ECONNREFUSED)
【发布时间】: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
        }
    ]
}

任何帮助将不胜感激。

【问题讨论】:

标签: node.js visual-studio-code electron


【解决方案1】:

我遇到了同样的问题,这里有一个解决方案。

我使用的选举版本不支持 --inspect 标志,在 devDependencies 选项中打开你的 package.json 将 electron 选项更改为最新版本。从这篇文章“1.7.9”开始

【讨论】:

    猜你喜欢
    • 2019-06-15
    • 2019-10-21
    • 2018-10-09
    • 2019-11-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-05
    • 1970-01-01
    • 2017-07-09
    相关资源
    最近更新 更多