我想调试在vscode中打开的当前.js文件。按F5运行。获取错误:"无法连接到运行时。确保运行时处于旧版调试模式。"
调试控制台显示错误: 使用旧协议进行调试,因为无法确定Node.js版本(错误:连接ECONNREFUSED 127.0.0.1:5858)
node.exe在我的路径中。 .vscode / launch.json包含type:node,request:launch,program:$ {file}。
为什么"无法连接到运行时"错误?
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}"
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 5858
}]