使用 Node Inspector 进行服务器端调试

对于服务器端调试,你需要使用 Node Inspector 之类的工具。在开始之前,请查看其中一些有用的教程。

HowToNode - 使用 Node Inspector
Strongloop 进行调试 - 调试应用程序
轻松调试 Meteor.js 演练,其中使用节点检查器和 Meteor 的屏幕截图

tl; dr - Meteor 生态系统中有许多实用程序,旨在与 Meteor 应用程序同时运行。它们仅在你的 Meteor 应用程序启动并运行时才能工作,并且可以连接到正在运行的网站。meteor mongo,Robomongo,Nightwatch ……这些都是需要你的应用程序才能运行的实用程序。NodeInspector 是这些实用程序之一。

# install node-inspector
terminal-a$  npm install -g node-inspector

# start meteor
terminal-a$  NODE_OPTIONS='--debug-brk --debug' mrt run

# alternatively, some people report this syntax being better
terminal-a$  sudo NODE_OPTIONS='--debug' ROOT_URL=http://myapp.com meteor --port 80

# launch node-inspector along side your running app
terminal-b$  node-inspector

# go to the URL given by node-inspector
http://localhost:8080/debug?port=5858