【问题标题】:Visual studio Code Debugger Not Working Fine For My Nodejs AppVisual Studio 代码调试器不适用于我的 Nodejs 应用程序
【发布时间】:2019-08-09 06:43:11
【问题描述】:

我正在尝试为我的 node.js 应用程序以及所有命令和代码使用 vs 代码调试器,但是当我应用断点时,它会返回到 nodejs 和 npm 文件的主文件和功能,而不是返回一步一步到服务,然后存储,刹车点不能正常工作,我的 api 任何机构都可以提供帮助

{
// 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": "attach",
        "name": "Attach by Process ID",
        "processId": "${command:PickProcess}"
    },

    {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${workspaceFolder}/app/app.js"
    },
    {
        "type": "node",
        "request": "launch",
        "name": "Launch via NPM",
        "runtimeExecutable": "npm",
        "runtimeArgs": [
            "run-script",
            "debug"
        ],
        "port": 9229
    },

    {
        "type": "node",
        "request": "launch",
        "name": "My Debugger",
        "program": "${workspaceFolder}\\index.js"
    }
    ]
    }

【问题讨论】:

    标签: node.js debugging visual-studio-code


    【解决方案1】:

    您是否尝试过附加到节点进程?

    Step 1: Run the code.
    Step 2: Press CMD + SHIFT + P then search for "Attach to Node Process" and it will list the running processes.
    Step 3: Choose the process you want to attach to.
    

    这将启用调试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-27
      • 2020-08-19
      • 2019-08-09
      • 1970-01-01
      • 2018-06-20
      • 1970-01-01
      • 2022-01-07
      • 2021-09-28
      相关资源
      最近更新 更多