[英]debug express js application visual studio code:
I am trying to debug my express js application through visual studio code here is my launch.json 我正在尝试通过Visual Studio代码调试我的Express JS应用程序,这是我的launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229
}
],
"compounds": []
}
And my application is running in port 3000 but when i run debugger i got the following error 我的应用程序在端口3000中运行,但是当我运行调试器时,出现以下错误
Debugging with legacy protocol because Node.js version could not be determined (Error: connect ECONNREFUSED 127.0.0.1:9229) 使用传统协议进行调试,因为无法确定Node.js版本(错误:连接ECONNREFUSED 127.0.0.1:9229)
You can change request as launch,add protocol as inspector in your file and put your main server file in program, here my server file called as server.js. 您可以将请求更改为启动,将协议添加为检查器,然后将主服务器文件放入程序中,这里我的服务器文件称为server.js。
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"protocol": "inspector",
"program": "${workspaceFolder}/server.js"
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.