如何在重新启动节点时重新启动节点检查程序? [英] How can I make node-inspector restart when node is restarted?

查看:166
本文介绍了如何在重新启动节点时重新启动节点检查程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用节点检查器很多。当我编辑我的代码并重新启动时,我得到了不可避免的



与目标分离



新进程启动时出错。我总是要找到选项卡节点检查器已打开并重新启动它。



我想知道我是否可以避免这种情况。例如,从节点向节点检查器发送消息,告诉运行node-inspector的浏览器选项卡重新启动。

解决方案



我发现新窗口不太可用,因为我更喜欢标签,但自动重新连接是如此可靠我会接受它!



我发现的唯一缺点就是它重新连接时会清除所有断点。


I use node-inspector a lot. When I edit my code and restart, I get the inevitable

Detached from the target

Error when a new process starts. I always have to go find the tab node inspector is on and restart it.

I was wondering if I could avoid this. For example, send a message to node-inspector from node to tell the browsers tab running node-inspector to restart.

解决方案

Cross-posting slightly from this SO, with an update to this topic.

There is a link in Chrome (58) standard Developer Pane which opens a new "headless" window which reconnects magically to node inspect no matter how the app is rebuilt / restarted.

I'm running Express.js e.g. DEBUG=myapp:* supervisor -- --inspect bin/www & and found it difficult to reconnect using the normal guid-laden URL which keeps changing. But this Chrome tool works all day reconnecting reliably.

Under Threads > Main, you should see "Node instance available. Connect".

I find the new-window less usable as I'd prefer a tab, but the auto-reconnect is so reliable I'll live with that!

The only downside I've found is when it does reconnect it clears all breakpoints.

这篇关于如何在重新启动节点时重新启动节点检查程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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