节点检查器无法连接到节点 [英] node-inspector fails to connect to node

查看:161
本文介绍了节点检查器无法连接到节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用

node --debug app
OR
node --debug-brk app

它响应

debugger listening on port 5858
Express server listening on port 1338

我现在启动节点检查器

node-inspector --web-port=5859

它以

Node Inspector v0.3.2
info  - socket.io started
Visit http://127.0.0.1:5859/debug?port=5858 to start debugging.

打开chrome并转到

Open chrome and go to

http://127.0.0.1:5859/debug?port=5858

控制台记录以下内容

使用TCPview,它显示节点正在侦听端口5858,但它没有建立的连接. 尝试连接时,此消息出现在节点控制台上

Using TCPview, it shows node is listening to port 5858 but it has no established connection. When the connection is attempted this message appears on the node console

}Content-Length: 108

没什么. 然后,我尝试使调试器在其他端口上运行:

Nothing else. I then tried to get the debugger to run on a different port:

node --debug=5000 app
node-inspector --debug-port=5000 --web-port=5859 

但是节点检查器无法连接 好吧,错误不在节点上.我安装了Eclipse节点环境,并且能够进行调试.决定让node-inspector怀疑并重新安装.

but node-inspector would not connect Well the error is not with node. I installed the Eclipse node environment and was able to debug. Decided to give node-inspector the benefit of the doubt and reinstall.

npm uninstall node-inspector
npm WARN uninstall not installed in C:\Program Files\nodejs\node_modules: "node-inspector"

重新安装的节点 重新安装Chrome 没有运气了,同样的问题.

re-installed node re-installed chrome No luck same problem.

所以是Eclipse.

So Eclipse it is.

推荐答案

第一次尝试,就是告诉节点检查器尝试在5859(不是默认值)上连接到调试器,然后告诉节点调试器侦听默认值5858.

With your first attempt, you're telling node-inspector to try to connect to the debugger on 5859 (not default), then telling node debugger to listen on the default 5858.

起始节点:node --debug-brk app.js,它将在5858上运行调试器.

Start node: node --debug-brk app.js and it will run the debugger on 5858.

启动节点检查器:node-inspector,它将尝试连接到5858.

Start node-inspector: node-inspector and it will try to connect to 5858.

在提供的URL中打开浏览器以访问Web界面,浏览器应加载源面板,并且应在应用程序的第一行中止执行.

Open your browser to the provided url to access the web interface and the browser should load up the sources panel and execution should be halted on the very first line of your app.

在您的第二次尝试中,您的方法看起来还不错,并且已经使用了node-inspector一年(目前在0.12.3方面苦苦挣扎),我想这很可能是node-inspector引起了那里的问题.

In your second attempt, your approach looks okay, and having used node-inspector for a year (presently struggling with 0.12.3), I'd say it was likely node-inspector causing the issue there.

这篇关于节点检查器无法连接到节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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