调试时 Eclipse+Node.js 错误:“无法连接到独立 V8 VM 连接超时”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8615226/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:29:35  来源:igfitidea点击:

Eclipse+Node.js error when debugging: "Failed to connect to Standalone V8 VM connect timed out"

eclipsenode.js

提问by Totty.js

Here is how I've done:

这是我的做法:

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

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

but in the image after "Now start making new debug configuration by clicking the “New” button:"

但是在“现在通过单击“新建”按钮开始进行新的调试配置之后的图像中:

my image is different.

我的形象是不同的。

However when I run the debug I get the "Failed to connect to Standalone V8 VM connect timed out" error;

但是,当我运行调试时,出现“无法连接到独立 V8 VM 连接超时”错误;

In the debug configuration I never set the main file to run when the server starts. so something must be missing...

在调试配置中,我从未将主文件设置为在服务器启动时运行。所以一定少了一些东西......

I have another little question...

我还有一个小问题...

when I run the "node --debug dbgtest.js" code it works... what I'm doing it wrong?

当我运行“node --debug dbgtest.js”代码时,它可以工作……我做错了什么?

thanks a lot

多谢

回答by Frederik Krautwald

You are doing nothing wrong. Of course the debugger will fail to connect if you are not running your node --debug dbgtest.js, which defaults to port 5858. It simply can't connect then.

你没有做错任何事。当然,如果您没有运行您的node --debug dbgtest.js,调试器将无法连接,默认为端口 5858。它根本无法连接。

You can specify different ports: node --debug[=port] dbgtest.js, as it also says in the beginning of the wiki link.

您可以指定不同的端口:node --debug[=port] dbgtest.js,正如 wiki 链接的开头所说。

回答by Sean F

This is an issue with the latest versions of node being incompatible with the Eclipse JDST node.js debugger.

这是最新版本的 node 与 Eclipse JDST node.js 调试器不兼容的问题。

I get the same error in Eclipse when using node 8.9.4. Tried a lot of things in Eclipse, nothing worked.

使用节点 8.9.4 时,我在 Eclipse 中遇到相同的错误。在 Eclipse 中尝试了很多东西,没有任何效果。

So I tried a node.js release from mid-2016, version 4.8.7. This was released around the time when the Eclipse JSDT/node integration was announced (http://www.eclipse.org/community/eclipse_newsletter/2016/may/article3.php). That version of node.js works fine with the latest Eclipse releases.

所以我尝试了 2016 年年中的 node.js 版本,版本 4.8.7。这是在宣布 Eclipse JSDT/节点集成时发布的(http://www.eclipse.org/community/eclipse_newsletter/2016/may/article3.php)。该版本的 node.js 适用于最新的 Eclipse 版本。

It's probably something minor that is getting in the way. The latest version produces the message: "DeprecationWarning: node --debugand node --debug-brkare invalid. Please use node --inspector node --inspect-brkinstead." It's given as a warning, but perhaps this is what is the underlying issue, perhaps node.js gives up when seeing --debug. Unfortunately, I cannot see how this could be changed in Eclipse without changing the code.

这可能是一些小事阻碍了。最新版本会产生以下消息:“DeprecationWarning: node --debugand node --debug-brkare invalid。请使用node --inspectornode --inspect-brk代替。” 它是作为警告给出的,但也许这就是潜在的问题,也许 node.js 在看到 --debug 时放弃了。不幸的是,如果不更改代码,我无法看到如何在 Eclipse 中进行更改。

The latest version of node that works is version 7. Starting with 8.0.0, it does not work.

最新的node版本是7版本,从8.0.0开始就不行了。

回答by Sascha N.

With nodejs version 8 the old debug-interface was removed and a new interface took it's place that's controlled via --inspectinstead of --debug.

在 nodejs 版本 8 中,旧的调试接口被删除,一个新的接口取而代之,它通过--inspect而不是--debug.

AFAIK there is no eclipse plugin that uses the new interface. Debugging can now be done using the chrome-browser, just search the www for "Debugging Node.js with Google Chrome"

AFAIK 没有使用新界面的 eclipse 插件。现在可以使用 chrome-browser 进行调试,只需在 www 上搜索“Debugging Node.js with Google Chrome”