【问题标题】:Debugging Node.js with Eclipse使用 Eclipse 调试 Node.js
【发布时间】:2012-01-01 00:53:10
【问题描述】:

我正在尝试使用适用于 V8 的 Google Eclipse 调试器插件来调试 Node.js (v0.6.1)。我正在使用Eclipse v4.1.0 on Windows7。我关注了Using Eclipse as Node Applications Debugger,但每当我尝试附加到正在运行的 Node.js(端口 5858)进程时,我都会收到一条弹出错误消息:

An internal error occurred during: "Debug session initialization: Node-5858".
Exception occured in callback

有什么建议吗?

【问题讨论】:

    标签: node.js eclipse-plugin


    【解决方案1】:

    我一直在研究类似的问题,这是我发现的

    设置说明,可能值得重新阅读以确保一切正常:

    https://github.com/joyent/node/wiki/Using-Eclipse-as-Node-Applications-Debugger

    请注意,在查看类似问题时,我在 google 代码上找到了这张帮助票,它与许多在 windows 上遇到 Node.js 问题的用户有关:

    http://code.google.com/p/chromedevtools/issues/detail?id=53

    可能值得只下载最新版本的 Node.js,因为我相信它现在已经修复,否则下载修复文件然后在票证中提及。

    【讨论】:

      【解决方案2】:

      您可以尝试测试Nodeclipse 0.2.0 beta 版。

      http://www.tomotaro1065.com/nodeclipse/

      生成快速项目

      Select the [File]-[New]-[Project] menu.
      Select [Node]-[Express Project], and push [Next] button.
      Enter [Project name], and push [Finish] button.
      

      调试

      Open the JavaScript source files that you want to set breakpoints.
      Double-click on the ruler at the left end of the line you want to set a breakpoint.
      If you want to remove a breakpoint, double-click on the ruler again.
      Select the main source file of Node Application on the Project Explorer, open the context menu by right-clicking, select the [Debug As]-[Node Application] menu.
      

      【讨论】:

      • 孤立链接被认为是一个糟糕的答案(请参阅faq),因为它本身没有意义并且目标资源不能保证在未来仍然存在It would be preferable 在此处包含答案的基本部分,并提供链接以供参考。 + 请务必仔细阅读faq。另请注意,每次链接到自己的网站/产品时都需要发布免责声明。
      【解决方案3】:

      试试这个:

      创建项目后,进入 cmd 并提供要调试的文件的文件路径。 现在运行命令 node --debug-brk demo_node.js (其中 demo_node.js 是文件名)

      现在来到eclipse这边,打开同一个文件,设置断点。 右键点击源文件,选择【Debug As】-【Node Application】。

      【讨论】:

        猜你喜欢
        • 2011-12-30
        • 2023-04-06
        • 2011-12-10
        • 1970-01-01
        • 2014-10-29
        • 1970-01-01
        • 1970-01-01
        • 2021-08-10
        • 2013-01-13
        相关资源
        最近更新 更多