为什么在Intellij IDEA 11中无法调试nodejs应用程序? [英] Why do I fail to debug a nodejs app in Intellij IDEA 11?

查看:872
本文介绍了为什么在Intellij IDEA 11中无法调试nodejs应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单进程node.js应用程序,我想使用Intellij IDEA 11 32位进行调试(node.js也是32位)。



所以我放置一个初始的断点并运行。调试器在断点处停止,但是它拒绝执行以下任何操作:




  • 进入

  • 转到另一个断点

  • 暂停执行



当我进入时,似乎只是为了运行,不需要通过代码。一旦运行,它会忽略任何后续的断点,当我按下暂停按钮时不会中断。



这个问题让我疯狂。
如何解决问题的任何想法?



编辑



更多信息。在IDEA在第一个断点(唯一的成功时间)之后,我尝试检查变量,看不到任何的。 IDEA被困在收集数据...上,手表窗口也不起作用。



EDIT2



Justed发布了一个问题到他们的错误跟踪系统 - http://youtrack.jetbrains.com/issue / IDEA-112925

解决方案

我一直在注意到IntelliJ的node.js调试器有点吸引。死亡1000次。我喜欢IntelliJ去死,这是一个很好的IDE。但是对于节点,调试器有一百万种不同的情况,其中断点不能正常工作,另外一百万个不正确地允许您访问范围内变量值,另外一百万个不能正常进行。



我要hafta尝试寻找另一个工具..



更新 2014-01-13:我一直在使用IntelliJ的调试器一段时间(发现没有其他好的工具)。它似乎有一些问题是节点或v8本身的问题。大部分我遇到的问题实际上都是由IntelliJ的较新版本解决,或者使用这种解决方法:



1 。创建一个名为proxyDebug.js的文件



2 。将以下内容放在其中:




require('path / to / the / script / you / want / to / debug .js')



3 。将您的调试器指向该文件



显然,在entrypoint脚本中,node.js调试钩子变得越来越麻烦,所以通过创建我们根本不在乎的代理入口点在 do 关心的脚本中不会有任何奇怪的错误。修复的这个解决方法的错误是错过了断点,预定义变量( export module process 等)由调试器无法访问,还有一个或两个我不记得的事情。


I have a single process node.js application, which I wish to debug with Intellij IDEA 11 32 bits (node.js is 32 bits too).

So, I place an initial breakpoint and run. The debugger stops at the breakpoint, but then it refuses to do any of the following:

  • step into
  • go to another breakpoint
  • pause execution

When I step into, it seems just to run, without stepping through the code. Once running, it ignores any subsequent breakpoints and does not break when I press the pause button.

This issue drives me crazy. Any ideas on how should I troubleshoot it?

EDIT

More info. After IDEA breaks on the first breakpoint (the only successful time) I try to inspect the variables and am unable to see any. IDEA is stuck on "Collecting data..." The watch window does not work too.

EDIT2

Justed posted an issue to their bug tracking system - http://youtrack.jetbrains.com/issue/IDEA-112925

解决方案

I've been noticing that IntelliJ's node.js debugger kinda sucks. It's death by 1000 cuts. I love IntelliJ to death, its such a nice IDE. But for node, the debugger has a million different scenarios where breakpoints don't work properly, and another million where it doesn't properly give you access to the in-scope variable values, and another million where it doesn't step properly...

I'm gonna hafta try looking for another tool..

UPDATE 2014-01-13: I've been using IntelliJ's debugger for a while now (having found no other good tool). It seems some of the problems with it are problems with node or v8 itself. Most of the problems I was having have either actually been solved by newer versions of IntelliJ, or by using this workaround:

1. create a file called proxyDebug.js

2. put the following content in it:

require('path/to/the/script/you/want/to/debug.js')

3. point your debugger to that file

Apparently the node.js debugging hooks go buggy at the entrypoint script, so by creating this proxy entrypoint that we don't care at all about, there won't be any weird bugs caused by that in the scripts you do care about. The bugs this workaround fixed were missed breakpoints, predefined variables (exports, module, process, etc) being inaccessible by the debugger, and one or two other things I can't remember.

这篇关于为什么在Intellij IDEA 11中无法调试nodejs应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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