Tag: 节点群集

无法debugging节点subprocess(使用节点本机debugging器)

我试图debugging节点subprocess,使用本地节点debugging器。 例如,看这个回购 。 我尝试了所有的选项王,根据: debug1 , debug1 , debug3 (和我在网上find很多其他的参考)。 非这些选项为我工作.. 这是我的示例代码: index.js: const spawn = require('child_process').spawn; const path = require('path'); const ls = spawn('node', [path.resolve('./child.js')], {execArgv: '–debug-brk=4545'}); ls.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); ls.stderr.on('data', (data) => { console.log(`stderr: ${data}`); }); ls.on('close', (code) => { console.log(`child process exited with code ${code}`); }); child.js: debugger; […]

如何在Windows上运行节点群集?

任何人都知道如何在Windows上运行节点群集? 我一直没有find网上的任何文章,似乎无法解决这个问题: events.js:160 throw er; // Unhandled 'error' event ^ Error: write ENOTSUP at exports._errnoException (util.js:1007:11) at ChildProcess.target._send (internal/child_process.js:634:20) at ChildProcess.target.send (internal/child_process.js:521:19) at sendHelper (cluster.js:751:15) at send (cluster.js:534:12) at cluster.js:509:7 at SharedHandle.add (cluster.js:99:3) at queryServer (cluster.js:501:12) at Worker.onmessage (cluster.js:449:7) at ChildProcess.<anonymous> (cluster.js:765:8) 而代码… if (cluster.isMaster) { for (let i = 0; i < numCPUs; i++) […]