I have been struggling to debug the server side code in my app. For the client, the browser debugger in chrome or firefox work like a charm but it is more complicated for the server
-
You can also debug server-side using the [WebStorm IDE](http://stackoverflow.com/questions/14751080/how-can-i-debug-my-meteor-app-using-the-webstorm-ide). – Dan Dascalescu Feb 12 '14 at 01:56
-
`meteor debug` did the trick on Meteor 1.1.0.2. – AlikElzin-kilaka Jul 11 '15 at 08:11
4 Answers
So here is how I managed it for meteor 0.5.6
there is no need to tinker with the run.js anymore
install node-inspector https://github.com/dannycoates/node-inspector
create an environment variable export NODE_OPTIONS='--debug'
run meteor
or mrt
command. It should tell you something like debugger listening on port 5858
Once the debugger is listening, you can start node-inspector and point your browser to Visit http://127.0.0.1:8080/debug?port=5858
I had a lot of fun with it :-)
For meteor 1.2.x and onward, everything is packaged in. Simply run meteor debug
and connect to the provided url

- 3,957
- 2
- 30
- 48
-
the latest version of Meteor (0.7.0.1) does not stop on breakpoints anymore in the latest version of node-inspector. The reason is still unknown (https://github.com/meteor/meteor/issues/1411) but there is a work around in putting debugger statements in the code :-( – Micha Roon Feb 13 '14 at 09:42
-
BTW, if you're using IntelliJ, you can do the steps Dr Gorb recommends, but just add a run configuration for "Node.js Remote Debug"; set the server to 127.0.0.1 (if you're debugging locally) and set the port to the port reported by the meteor command, usually 5858. This works great with 0.8 and IntelliJ 13. – occasl Apr 21 '14 at 18:42
-
1On Linux Mint, in Chrome, I was unable to use the url as provided with IP address of 0.0.0.0. Chrome kept doing a Google search. I'd recommend that you use the link that node-inspector gives you, which is usually going to be http://127.0.0.1:8080/debug?port=5858 – jazeee Mar 13 '15 at 16:58
-
I am getting error ` Meteor cannot currently handle quoted NODE_OPTIONS`. I am not sure what needs to be done !! – SharpCoder Oct 22 '15 at 20:31
-
simply run meteor debug to launch your application if you are using meteor 1.2.x as you should – Micha Roon Oct 24 '15 at 12:39
In this video Slava Kim explains how someone can debug a Meteor app at server side. First you have to install node-inspector
npm install -g node-inspector
and then run the Meteor app with a specific variable
env NODE_OPTIONS="--debug" meteor
in new terminal tab open the node-inspector by run the command
node-inspector
copy and paste the url from node-inspector on Chrome and you will find all the server side code to set breakpoints for debug. Important: Set the breakpoints on your project's files at the (no domain) folder

- 111
- 1
- 3
I use both Node-inspector and Loggly to debug my Meteor server.
Node-inspector is AWESOME but if I have testers telling me about issues or issues happen in production, it doesn't tell me about EXACTLY what they did or what hardware/network conditions they're on. Logging however can tell you about the step & conditions that caused an issue which allows you debug with better information.

- 11
- 2
As of Meteor 1.1.0.2, meteor debug
does the trick on Meteor 1.1.0.2.
See more info here.

- 1
- 1

- 34,335
- 35
- 194
- 277