簡體   English   中英

Visual Studio代碼調試器不適用於我的Node.js應用程序

[英]Visual studio Code Debugger Not Working Fine For My Nodejs App

我正在嘗試為我的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"
    }
    ]
    }

您是否嘗試附加到節點進程?

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.

這樣可以進行調試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM