且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用节点检查器调试meteorjs应用程序

更新时间:2023-11-18 18:23:46

看看 https://groups.google.com/forum/#!topic/meteor-talk/EG8pe7pF3f8


只需要分享一些使用节点检查器到
调试服务器端代码的经验:
1.当你运行Meteor,它将在Linux机器上生成两个进程
(注意:我没有在Windows或Mac机上检查)

  process1:/ usr / lib / meteor / bin / node / usr / lib / meteor / app / meteor / 

meteor.js

  process2:/ usr / lib / meteor / bin / node / home / paul / codes / bbtest_code / 

bbtest02 / .meteor / local / build / main.js --keepalive


  1. 您需要在process2上发送kill -s USR1


  2. 运行节点检查器,你可以ee您的服务器代码


在我第一次尝试时,我修改了/ $ b $中流星启动脚本的最后一行b usr / lib / meteor / bin / meteor to



exec$ DEV_BUNDLE / bin / node$ NODE_DEBUG$ METEOR$ @



并在命令提示符下运行NODE_DEBUG = - 调试流星。这只能在process1上放置
调试标志,所以我只在node-inspector
上看到流星文件,找不到我的代码。
有关如何修改脚本的建议,我们可以在流星脚本上使用--debug
标志?
干杯,
保罗



I am trying to debug a meteor application at server side.

I created an environment variable export NODE_OPTIONS='--debug'.

I run meteor (version 0.7.0.1) command. It tells the debugger listening on port 5858.

I start node-inspector (version v0.7.0-2) and point to 127.0.0.1:8080/debug?port=5858, but I can see only a couple of strings, Source, Console and a prompt > where I cannot write anything.

I have this error in the console: "The connection to ws//127.0.0.1:8080/socket.io/1/websocket/Za… was interrupted while the page was loading".

The same if I use 0.0.0.0:8080: I can see something more of the debugger on the right panel, as Watch expression, Call stack, but the Source list is still empty.

Node-inspector should be listening, because if I stop meteor says that the remote debugging has been terminated. I cannot figure out what I am doing wrong.

have a look at https://groups.google.com/forum/#!topic/meteor-talk/EG8pe7pF3f8

Just want to share some of my experience on using node-inspector to debug server side codes: 1. When you run Meteor, it will spawn two processes on Linux machine (Note: I have not checked this on Windows or Mac machine)

 process1: /usr/lib/meteor/bin/node /usr/lib/meteor/app/meteor/

meteor.js

 process2: /usr/lib/meteor/bin/node /home/paul/codes/bbtest_code/

bbtest02/.meteor/local/build/main.js --keepalive

  1. You need to send kill -s USR1 on process2

  2. Run node-inspector and you can see your server code

On my first try, I modify the last line on meteor startup script in / usr/lib/meteor/bin/meteor to

exec "$DEV_BUNDLE/bin/node" $NODE_DEBUG "$METEOR" "$@"

and run NODE_DEBUG=--debug meteor on command prompt. This only put -- debug flag on process1 so I only see meteor files on node-inspector and could not find my code. Any suggestion on how to modify the script so we can use "--debug" flag on the meteor script? Cheers, Paul