如何使用WebStorm IDE调试我的Meteor应用程序? [英] How can I debug my Meteor app using the WebStorm IDE?
问题描述
任何人都可以提供有关如何将Meteor应用程序连接到WebStorm调试器的简单步骤?
Can anyone provide a short list of steps on how to connect a Meteor app to the WebStorm debugger please?
推荐答案
WebStorm是唯一支持调试流星服务器代码的IDE,请检查此视频。即使在Windows上,调试非常简单:
WebStorm is the only IDE with native support for debugging Meteor server code - check this video. Even on Windows, debugging is very simple:
转到运行 - >调试 - - >编辑配置...,点击加号,点击流星。如果需要,可以添加ROOT_URL等环境变量。
Go to Run --> Debug --> Edit configurations... , click the plus sign, click "Meteor". You can add environment variable like ROOT_URL if you need to.
此答案仅用于历史目的。您应该升级WebStorm。
This answer is kept only for historical purposes. You should upgrade WebStorm.
在较旧的WebStorm上,您以前必须创建一个Node.js调试配置。
On older WebStorms, you used to have to create a Node.js debugging configuration.
-
在服务器上导出环境变量
NODE_OPTIONS = - debug = 47977
。例如,
NODE_OPTIONS=--debug=47977 meteor # Linux/Mac
set NODE_OPTIONS=--debug=47977 & meteor` # Windows
使用上面的端口创建一个WebStorm / PhpStorm运行/调试配置47977)和服务器主机。如果您正在本地调试,请离开127.0.0.1。
create a WebStorm/PhpStorm Run/Debug configuration using the port above (47977) and the server host. Leave 127.0.0.1 if you're debugging locally.
运行/调试confioguration>
- 在WebStorm中运行 - >调试< myapp>或按Shift + F9。确保您在调试面板中看到已连接到<您的主机>
- in WebStorm, Run -> Debug <myapp>, or press Shift+F9. Make sure that you see "Connected to <your host> in the Debug panel
现在您可以设置断点,可以访问本地变量等
Now you can set breakpoints, have access to local variables etc.
对于客户端调试,只需使用Chrome调试器或Firebug。
For client debugging, just use the Chrome debugger, or Firebug.
-
进程意外断开
- 当meteor因为缺少特定的支持Meteor,只需运行 - > Debug< myapp>或再次按Shift + F9。
Process disconnected unexpectedly
- this happens when meteor restarts automatically because of lack of specific support for Meteor. Just Run -> Debug <myapp>, or press Shift+F9 again.
您无法连接到服务器 - 确保防火墙规则允许传入连接到您为Node.js调试器选择的任何端口(47977)。
you can't connect to the server - make sure the firewall rules allow incoming connections to whatever port you chose for the Node.js debugger (47977 here).
这篇关于如何使用WebStorm IDE调试我的Meteor应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!