Debugging Node.js processes with cluster.fork()

前端 未结 6 2131
南方客
南方客 2020-12-23 21:39

I\'ve got some code that looks very much like the sample in the Cluster documentation at http://nodejs.org/docs/v0.6.0/api/cluster.html, to wit:

var cluster          


        
6条回答
  •  粉色の甜心
    2020-12-23 22:13

    For anyone looking at this in 2018+, no startup arguments are necessary.

    From this Github issue:

    Just a time saver for anyone who might have been in the same boat as me-- the Node.js V8 --inspector Manager (NiM) seems to introduce this issue when it otherwise wouldn't be present-- I spent about an hour banging my head before disabling the Chrome plugin and discovering that everything worked fine when opening from chrome://inspect.

    I also spent hours reading github posts, tweaking the settings of gulp-typescript and gulp-sourcemaps, etc, only to have that plugin be the issue. Also worth noting is that I had to add port N+1 to the remote targets of chrome://inspect, so localhost:9230, to debug my worker process.

提交回复
热议问题