Unitech/pm2 · critical · Error

PM2 cannot run on Bun version < 1.1.25 (cluster support)

Error message

PM2 cannot run on Bun version < 1.1.25 (cluster support)

What it means

PM2 relies on Bun's cluster support, which only became usable in Bun 1.1.25. At CLI load time it checks the Bun version via semver.lt and aborts immediately on older Bun, because cluster mode would otherwise silently malfunction.

Source

Thrown at lib/binaries/CLI.js:21

process.env.PM2_USAGE = 'CLI';

var cst          = require('../../constants.js');

var commander    = require('commander');
var chalk        = require('ansis');
var forEachLimit = require('async/forEachLimit');

var debug        = require('debug')('pm2:cli');
var PM2          = require('../API.js');
var pkg          = require('../../package.json');
var tabtab       = require('../completion.js');
var Common       = require('../Common.js');
var PM2ioHandler = require('../API/pm2-plus/PM2IO');

var semver = require('semver')

if (cst.IS_BUN === true && semver.lt(process.versions.bun, '1.1.25')) {
  throw new Error('PM2 cannot run on Bun version < 1.1.25 (cluster support)')
}

Common.determineSilentCLI();
Common.printVersion();

var pm2 = new PM2();

PM2ioHandler.usePM2Client(pm2)

commander.version(pkg.version)
  .option('-v --version', 'print pm2 version')
  .option('-s --silent', 'hide all messages', false)
  .option('--ext <extensions>', 'watch only this file extensions')
  .option('-n --name <name>', 'set a name for the process in the process list')
  .option('-m --mini-list', 'display a compacted list without formatting')
  .option('--interpreter <interpreter>', 'set a specific interpreter to use for executing app, default: node')
  .option('--interpreter-args <arguments>', 'set arguments to pass to the interpreter (alias of --node-args)')
  .option('--node-args <node_args>', 'space delimited arguments to pass to node')

View on GitHub (pinned to 31adee8048)

Solutions

  1. Upgrade Bun to >= 1.1.25 (`bun upgrade`).
  2. Run PM2 under Node.js instead of Bun if you cannot upgrade Bun.
Defensive patterns

Strategy: validation

Validate before calling

const semver = require('semver');
if (process.versions.bun && semver.lt(process.versions.bun, '1.1.25')) {
  throw new Error('Upgrade Bun to >=1.1.25 before running PM2, or run under Node.js');
}

Type guard

const bunOkForPm2 = () => !process.versions.bun ||
  require('semver').gte(process.versions.bun, '1.1.25');

Prevention

When it happens

Trigger: Launching the PM2 CLI under a Bun runtime older than 1.1.25 (e.g. `bun pm2 ...` or the pm2 bin resolving to bun).

Common situations: CI pinned to an older Bun; a system-wide bun that hasn't been upgraded; an image shipping an outdated bun.


AI-assisted analysis of Unitech/pm2@31adee8048 (2026-08-13). Data as JSON: /api/errors/be0bcceeadfd8fbb. Report an issue: GitHub.