错误:无法连接到运行时; 确保运行时处于"传统"调试模式

Ada*_*ela 5 node.js pm2 visual-studio-code

我在尝试使用Visual Studio Code调试Node.js脚本时看到了上述内容.

我的launch.json样子

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "Attach to Process",
            "protocol": "legacy",
            "processId": "${command:PickProcess}"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

无论我是否放线"protocol": "legacy",,我都得到与上面完全相同的错误.我的环境系统:OSX节点:v8.6.0 VSC:1.17.2另外,我用PM2运行节点脚本.

任何建议都将非常感激

Eug*_*ene 5

Node v8.6不支持"legacy"协议.您应该使用"检查员"协议.