我正在寻找逐步调试NodeJS服务器代码的有效方法。目前,我使用了数十个console.log(),这非常困难。完美的工具是允许我检查堆栈中每个变量的值并逐行跟踪程序的工具。首选OS = MacOS / Linux。可能吗?
这个怎么样?
您可以尝试测试Nodeclipse 0.2.0 beta版。
http://www.tomotaro1065.com/nodeclipse/
这将帮助您轻松调试节点应用程序。
快递项目的产生
> Select the [File]-[New]-[Project] menu. > Select [Node]-[Express Project], and push [Next] button. > Enter [Project name], and push [Finish] button.
调试
> Open the JavaScript source files that you want to set breakpoints. > Double-click on the ruler at the left end of the line you want to set a > breakpoint. > If you want to remove a breakpoint, double-click on the ruler again. > Select the main source file of Node Application on the Project Explorer, > open the context menu by right-clicking, > select the [Debug As]-[Node Application] menu.