VSCode 调试不适用于 NodeJs 应用程序 [英] VSCode debugging not working for NodeJs application

查看:26
本文介绍了VSCode 调试不适用于 NodeJs 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 launch.json 文件中添加了配置,其中包含以下详细信息:

I have added the configuration in the launch.json file with the following details :

{
    "name": "Attach"
    "type": "node",
    // TCP/IP address. Default is "localhost".
    "address": "localhost",
    // Port to attach to.
    "port": 5858
}

现在我使用以下命令启动我的应用程序:node --debug-brk ./bin/www

Now I start my app with the following command : node --debug-brk ./bin/www

当我转到 VSCode 并在顶部的调试菜单中选择 Attach 并单击播放按钮时.它附加,但是当我转到浏览器并打开一个页面时,它不是我的 index.js 文件中的断点或处理程序函数.你能帮忙看看哪里出了问题吗?

When i go to VSCode and select Attach in the debugging menu on the top and click on the play button. It attaches, but when i go to browser and open a page, it doesn't it the breakpoint or the handler function in my index.js file. Can you please help what could be going wrong?

推荐答案

您的断点可能设置得太早,并且没有被节点注册.如果您在附加后设置断点应该会有所帮助.

Your breakpoints are probably set too early and are not registered by node. It should help if you set the breakpoints after you have attached.

我们在 VSCode 中改进了这种体验,它应该在 0.4.0 中可用

We have improved this experience in VSCode and it should be available in 0.4.0

这篇关于VSCode 调试不适用于 NodeJs 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆