xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

VSCode & Node.js & debugger & inspector

VSCode & Node.js & debugger & inspector

F5

ws 元信息 (UUID)

ws://127.0.0.1:46912/efa91bda-1ffc-4bd1-a80a-6f5f3b25c4f9

http://127.0.0.1:46912/json

https://nodejs.org/en/docs/guides/debugging-getting-started/

chrome-devtools

chrome-devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=127.0.0.1:23107/f823a6fb-04ee-47c6-9980-8f86bfdd575e

.vscode/launch.json

https://go.microsoft.com/fwlink/?linkid=830387

{
  // 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": "launch",
      "name": "Launch Program",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${workspaceFolder}/000-xyz/vscode-debug-node/index.js"
    }
  ]
}


Chrome Devtools

node --inspect app.js

https://github.com/xgqfrms/Node.js/issues/7


node --inspect app.js 激活

Debugger attached

image

image

.vscode/settings.json

{
    "editor.fontSize": 16,
    "editor.renderWhitespace": "all",
    "path-intellisense.mappings": {
        "@": "${workspaceRoot}/src/operate-tool/src"
    },
    "editor.tabSize": 2,
    // 激活 node inspect debugger
    "debug.node.autoAttach": "on",
}


posted @ 2020-02-08 23:36  xgqfrms  阅读(336)  评论(7编辑  收藏  举报