--options max_old_space_size can not run in cluster mode
See original GitHub issuesuch as :
file FCSAppCluster376.js include :
const cluster = require(‘cluster’);
if (cluster.isMaster) {
console.log(Master ${process.pid} is running
);
var prc=cluster.fork();
…
} else {
require(‘./FCSApp.js’);
console.log(Worker ${process.pid} started
);
}
pkg -t win -c ./config.json ./FCSAppCluster376.js --options max_old_space_size=4096
when run FCSAppCluster376.exe report err: Error: Cannot find module ‘E:\Code\nodejs\EDC376\FCSNode376--max_old_space_size=4096’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1287:46) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Function.Module.runMain (pkg/prelude/bootstrap.js:1316:12) at startup (internal/bootstrap/node.js:320:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:659:3) worker 7048 died.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (1 by maintainers)
I have a smal work around. With this it is not possible to configurate the max_old_space_size from a worker, but the max_old_space_size from the master.
I used:
Temporary solution:
https://github.com/vercel/pkg/issues/1047#issuecomment-1293431841