且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

节点检查员与快递4

更新时间:2023-11-18 17:43:40

更新 m很确定这是你的问题:

Update: I'm pretty sure this is your problem:


节点--debug bin / www然后启动node-debugger bin / www。 p>

node --debug bin/www and then start the node-debugger bin/www.

不要做那些 BOTH 。这是一个或另一个。他们是做同样事情的两种方式。无论您是否使用节点检查器,我都喜欢以前的方法,因为它更简单,并且与节点本身一起使用。

Don't do BOTH of those. It's one or the other. They are 2 ways of doing the same thing. I prefer the former way as it's simpler and works with node itself whether or not you are using node-inspector.

总结:


  • node-debug bin / www 在调试模式下启动您的应用程序,并在同一进程中启动节点检查器

  • 节点--debug bin / www 以调试模式启动您的应用程序。这应该与单独的终端窗口组合,您可以单独运行 node-inspector 作为单独的进程。我推荐这种方法,但是应该可以使用。

  • node-debug bin/www starts both your app in debug mode AND node-inspector in the same process
  • node --debug bin/www starts your app in debug mode. This should be combined with a separate terminal window where you run node-inspector as a separate process. I recommend this approach, but either should work.

这是我的建议,这个。尝试使用最简单的命令形式来运行:

Here's my suggestion to start troubleshooting this. Try to use the simplest form of the commands to get everything running:


  • 在您的流氓主机内的一个ssh会话终端中,直接启动您的应用在节点的前台,--debug ./bin/www

    • v8将尝试绑定到端口5858.你应该看到这个消息调试器监听端口5858,而不是此消息无法打开端口5858上的套接字,等待1000 ms重试之前

    • 如果您看到无法打开套接字在端口5858消息,还有一个进程已经在侦听。运行 sudo netstat -ntlp 以查看它是哪个进程,了解它是什么,为什么它正在运行,然后杀死它以释放端口杀死< pid-you-got-from-netstat>

    • in one ssh session terminal inside your vagrant host, start your app directly in the foreground with node --debug ./bin/www
      • v8 will try to bind to port 5858. You should see this message "debugger listening on port 5858" and NOT this message "Failed to open socket on port 5858, waiting 1000 ms before retrying"
      • If you see the "Failed to open socket on port 5858" message, there's another process already listening. run sudo netstat -ntlp to see which process it is, comprehend what it is and why it is running, and then kill it to free up the port kill <pid-you-got-from-netstat>