量角器Visual Studio代码调试错误无法连接到运行时进程,10000秒后超时

时间:2019-06-19 06:03:59

标签: visual-studio-code protractor

量角器Visual Studio代码调试错误无法连接到运行时进程,在10000秒后超时-(原因:无法连接到目标:连接ECONNREFUSED 127.0.0.1:36406)。

下面是我的launch.json文件配置

    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [        
        {            
            "type": "node",
            "request": "launch",
            "name": "Launch via npm",            
            "cwd": "${workspaceRoot}",
            "runtimeExecutable": "npm.cmd",
            "runtimeArgs": [
                "run-script", "regression_sat",
                "--inspect=5858"
            ]
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to Process",
            "port": 5858
        }
    ]
}

及以下是带有脚本标签的package.json文件

"scripts": {
    "webdriver-start": "npm_webdriver.bat",
    "protractor": "protractor_batch.bat"
    "regression_sat": "node_modules/.bin/protractor.cmd ./config/protractor.chrome.conf.js --suite suite_sat --params.env sat"
  }

1 个答案:

答案 0 :(得分:0)

导致此错误的最可能原因是当调试会话终止时,Visual Studio 启动的浏览器窗口仍在运行。这会阻止下一个调试会话成功启动。

完成调试会话后,关闭浏览器窗口本身,而不是运行应用程序的选项卡。这将确保下一个调试会话可以启动一个新的浏览器实例进行调试。