2017-07-28 635 views
0

我在OSX上有一個最小的Electron應用程序設置,通過命令行運行時工作正常,但我無法使用Visual Studio代碼在調試模式下運行:Electron/VSCode:無法連接到運行時進程,10000 ms後超時 - (ECONNREFUSED)

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 
     } 
    ] 
} 

任何幫助將非常感激。

+1

查看[調試主進程](https://github.com/electron/electron/blob/master/docs/tutorial/debugging-main-process.md) – RoyalBingBong

+1

添加「協議」:「傳統」配置 – JerryGoyal

回答

0

我遇到了同樣的問題,這裏有一個解決方案。

我使用的選舉版本不支持--inspect標誌,在devDependencies選項中打開您的package.json將electron選項更改爲最新版本。截至此帖「1.7.9」

相關問題