如何调试 Node.js 应用程序? [英] How do I debug Node.js applications?

查看:44
本文介绍了如何调试 Node.js 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何调试 Node.js 服务器应用程序?

How do I debug a Node.js server application?

现在我主要使用警报调试和这样的打印语句:

Right now I'm mostly using alert debugging with print statements like this:

sys.puts(sys.inspect(someVariable));

一定有更好的调试方法.我知道 Google Chrome 有一个命令行调试器.这个调试器也适用于 Node.js 吗?

There must be a better way to debug. I know that Google Chrome has a command-line debugger. Is this debugger available for Node.js as well?

推荐答案

V8 作为 Google Chrome 开发者工具的一部分发布的调试器可用于调试 Node.js脚本.可以在 Node 中找到有关其工作原理的详细说明.js GitHub 维基.

The V8 debugger released as part of the Google Chrome Developer Tools can be used to debug Node.js scripts. A detailed explanation of how this works can be found in the Node.js GitHub wiki.

这篇关于如何调试 Node.js 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆