更改Meteor Node-Inspector Web端口

时间:2015-12-23 20:19:11

标签: debugging meteor port node-inspector

我需要在调试Meteor时更改node-inspector使用的Web端口,但它似乎总是在8080上运行,这是我需要运行Meteor网络应用程序的地方。

我在尝试运行Meteor之前尝试设置NODE_OPTIONS环境变量:

$ export NODE_OPTIONS=--debug=47977
$ meteor debug --port=8080
[[[[[ ~/.../src ]]]]]
=> Started proxy.                              
=> Started MongoDB.                           
   Starting your app                         -
Your application is now paused and ready for debugging!

To debug the server process using a graphical debugging interface, 
visit this URL in your web browser:
http://localhost:8080/debug?port=5858

Paused at /.../src/.meteor/local/build/main.js:7
Cannot start the server at 0.0.0.0:8080. Error: listen EADDRINUSE.
There is another process already listening at this address. 
Run `node-inspector --web-port={port}` to use a different port.

我尝试在另一个网络端口上单独运行node-inspector然后启动meteor,但meteor似乎也总是试图在8080上启动node-inspector:

$ node-inspector --web-port=47977 &
[1] 74439
$ Node Inspector v0.5.0
   info  - socket.io started
Visit http://127.0.0.1:47977/debug?port=5858 to start debugging.

$ meteor debug --port=8080
[[[[[ ~/.../src ]]]]]
=> Started proxy.                             
=> Started MongoDB.                           
   Starting your app                         -
Your application is now paused and ready for debugging!

To debug the server process using a graphical debugging interface, 
visit this URL in your web browser:
http://localhost:8080/debug?port=5858

Paused at /.../src/.meteor/local/build/main.js:7
Cannot start the server at 0.0.0.0:8080. Error: listen EADDRINUSE.
There is another process already listening at this address.
Run `node-inspector --web-port={port}` to use a different port.

注意,这里有3个端口:

  1. 8080 - 运行Meteor网络应用程序的Web端口。
  2. 47977 - Web端口我想运行node-inspector web app。
  3. 5858 - 用于在其他两个进程之间进行通信的端口。
  4. 我需要Meteor在8080上运行,但似乎也无法在8080上停止Meteor启动节点检查器。我还尝试了一些其他端口用于节点检查器,但结果相同。

    使用Meteor 1.2.1在Mac上运行

1 个答案:

答案 0 :(得分:0)

我有同样的问题,我已经解决了:

终端运行中的

node-inspector --web-port=47977

并在新的终端运行meteor debug

转到http://127.0.0.1:47977/ws=127.0.0.1:47977&port=5858开始调试。