How to debug node js app with breakpoints and everything?
I've installed node-inspector just to find out that it doesn't support breakpoints :| What's the point in it at all, bearing in mind that on big part node code is asynchronous and you simply cannot follow it step by step?..
I'm definitely missing a point here...
Anyway to debug node code with breakpoints and everything?
yupp, I've successfully used node-inspector. If you want permanent breakpoints, simply insert debugger;
in your code. See http://nodejs.org/api/debugger.html.
Making node wait until a debugger is attached, using node --debug-brk script.js
, can also be very helpful.
I think You can get your answers from this Link
And one more thing is you can push dynamic changes to V8 Debugger too.
Just to elaborate a bit here:
Set a debugger wherever you want the breakpoints to be and then run your code with node debug script.js/index.js
When the debugger stops at you breakpoint, you will need to repl to inspect the variables.
链接地址: http://www.djcxy.com/p/52650.html上一篇: 如何在Electron呈现的网页上调用JavaScript函数?
下一篇: 如何调试节点js应用程序的断点和一切?