{"id":10642,"library":"cluster","title":"LearnBoost Cluster Manager","description":"This `cluster` package, developed by LearnBoost, is an extensible multi-core server manager for Node.js applications, last released as version 0.7.7. It was created to provide advanced process management features such as zero-downtime restarts, graceful shutdowns, worker resuscitation, and configurable worker counts (defaulting to CPU cores), during a period when the native Node.js `cluster` module was either unavailable or less feature-rich (specifically, between Node.js v0.4 and v0.8). The library offers a robust plugin system, including built-in plugins for command-line interfaces, debugging, logging, PID file management, automatic reloads, and REPL-based administration. Despite its innovative features for its time, the project is considered abandoned, with the last substantial development activity over a decade ago and official support for only very old Node.js versions (0.2.x, 0.4.x). It does not function with contemporary Node.js runtimes, making it a historical artifact rather than a viable solution for modern applications.","status":"abandoned","version":"0.7.7","language":"javascript","source_language":"en","source_url":"git://github.com/LearnBoost/cluster","tags":["javascript","server","spark","fugue","tcp","workers"],"install":[{"cmd":"npm install cluster","lang":"bash","label":"npm"},{"cmd":"yarn add cluster","lang":"bash","label":"yarn"},{"cmd":"pnpm add cluster","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and incompatible with ES Modules. Use `require`.","wrong":"import cluster from 'cluster';","symbol":"cluster","correct":"const cluster = require('cluster');"},{"note":"Internal class, primarily accessed via the `cluster()` initializer, not typically directly imported for use. Exposed for advanced extension.","wrong":"import { Master } from 'cluster';","symbol":"Master","correct":"const Master = require('cluster').Master;"},{"note":"While `cluster('./app')` was shown in old examples, passing an explicit `http.Server` instance from a required module (`./app`) or defining it inline is safer and clearer. The `./app` string was meant to `require` the module internally.","wrong":"const cluster = require('cluster');\ncluster('./app').listen(3000);","symbol":"cluster('app')","correct":"const serverApp = require('./app');\nconst clusterManager = require('cluster');\nclusterManager(serverApp).listen(3000);"}],"quickstart":{"code":"const http = require('http');\nconst cluster = require('cluster');\n\n// app.js (or inline server definition)\nconst app = http.createServer(function(req, res){\n  console.log('Worker %s handling request for %s %s', process.pid, req.method, req.url);\n  const body = 'Hello World from worker ' + process.pid;\n  res.writeHead(200, { 'Content-Length': Buffer.byteLength(body) });\n  res.end(body);\n});\n\n// server.js (main cluster entry point)\nif (require.main === module) {\n  cluster(app)\n    .use(cluster.logger('logs')) // Example plugin: logs master/worker activity\n    .use(cluster.stats())     // Example plugin: adds real-time statistics\n    .use(cluster.pidfiles('pids')) // Example plugin: writes master/worker pidfiles\n    .use(cluster.cli())       // Example plugin: provides a command-line interface\n    .use(cluster.repl(8888))  // Example plugin: real-time administration via REPL\n    .listen(3000, function(){\n      console.log('Cluster listening on port 3000, with %d workers', cluster.workers.length);\n    });\n  console.log('Master process %s started.', process.pid);\n} else {\n  // When required by the master, just export the app\n  module.exports = app;\n}","lang":"javascript","description":"This quickstart demonstrates how to initialize the LearnBoost Cluster manager with an HTTP server and enable several of its bundled plugins for logging, statistics, PID file management, CLI, and REPL. It shows the typical CJS `require` pattern for setting up a multi-process Node.js application, with one master process managing multiple worker processes."},"warnings":[{"fix":"Do not use this package. Migrate to Node.js's built-in `cluster` module or a modern process manager like PM2, Forever, or similar libraries designed for current Node.js runtimes.","message":"This package is abandoned and incompatible with modern Node.js versions (e.g., Node.js 6.x and above). It was last updated for Node.js 0.2.x and 0.4.x. Attempting to use it will result in runtime errors or unexpected behavior.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Ensure explicit installation (`npm install cluster`) and verify `node_modules` resolution if you must use this legacy package. It is strongly recommended to use Node.js's native `cluster` module for modern applications.","message":"The package name `cluster` directly conflicts with Node.js's built-in `cluster` module. Importing `require('cluster')` might load the native module instead of this third-party package if not installed or resolved carefully, leading to API mismatches and errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Immediately cease using this package. Migrate to actively maintained alternatives to ensure security and stability.","message":"As an abandoned package with no updates for over a decade, `LearnBoost/cluster` has not received security patches for known vulnerabilities in Node.js or its dependencies. Using it in production could expose applications to significant security risks.","severity":"security","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"If intending to use the LearnBoost package, ensure it is correctly installed and that the module resolver picks it up. However, due to its abandonment, the recommended fix is to migrate to Node.js's native `cluster` module, which has a different API.","cause":"This error often occurs when `require('cluster')` resolves to Node.js's built-in `cluster` module instead of the LearnBoost package, as the native module does not export a top-level function for initialization.","error":"TypeError: cluster is not a function"},{"fix":"Run `npm install cluster`. If the issue persists, verify your `node_modules` directory and Node.js environment. (Note: This package is not recommended for new projects).","cause":"The package was not installed or is not resolvable from the current working directory, or the `npm install cluster` command failed.","error":"Error: Cannot find module 'cluster'"},{"fix":"This package is incompatible with modern Node.js. There is no fix to make this package work on recent Node.js versions. You must migrate to Node.js's native `cluster` module or other modern process management solutions.","cause":"The LearnBoost `cluster` package makes low-level assumptions about the Node.js internal API and C++ bindings that are fundamentally incompatible with modern Node.js runtime changes.","error":"Segmentation fault (core dumped) or similar native crashes with modern Node.js."}],"ecosystem":"npm"}