激活 nodejs 调试
node --inspect app.js
将VS Code调试部分内容做了笔记,https://github.com/LinG955/node-debug/tree/master
--inspect-brk
node --inspect=127.0.0.1:8888 app.js
node --inspect=8888 app.js
node --inspect=127.0.0.1:8888 app.js
node --inspect=8888 app.js
https://nodejs.org/api/debugger.html
https://nodejs.org/en/docs/guides/debugging-getting-started/
多配置, launch
args cmd
F5
launch.json
vscode settings.json
// 激活 node inspect debugger
"debug.node.autoAttach": "on",
launch config
VS Code
内存溢出
snapshot 快照
add folder
代码性能优化,调试
call stack
hot modify
Ctrl + P === open file
打开方式 3
chrome://inspect
chrome-devtools:
Chrome devtools
vscode
.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", }
打断点
重启server
访问 URL
debugger