使用节点检查器调试meteorjs应用程序 [英] Debug meteorjs application with node-inspector

查看:239
本文介绍了使用节点检查器调试meteorjs应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器端调试一个流星应用程序。



我创建了一个环境变量导出NODE_OPTIONS =' - debug'。



我运行流星(版本0.7.0.1)命令。它告诉调试器监听端口5858。



我启动node-inspector(版本v0.7.0-2)并指向127.0.0.1:8080/debug?port = 5858,但是我可以看到只有几个字符串,Source,Console和一个提示>我无法写任何东西。



我在控制台中有这个错误:
与ws // 127.0.0.1:8080 / socket.io / 1 / websocket / Za ...的连接在页面加载时中断。



同样如果我使用0.0.0.0:8080:我可以看到更多的调试器在右侧面板,作为Watch表达式,调用堆栈,但源列表还是空的



节点检查员应该听,因为如果我停止流星说远程调试已经终止。我不知道我做错了什么。

解决方案

看看 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

这篇关于使用节点检查器调试meteorjs应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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