Repository navigation
Releases
Releases · Unitech/pm2
v7.1.2
7.1.2
Bug Fixes
pm2 updateunder apm2 startupsystemd unit no longer gets its new daemon and apps killed byExecStop=pm2 kill(systemd >= 232) #5000filter_env: trueworks again (ignored since 4.4.1): apps only inherit PATH, HOME, USER, locales and a few OS variables besides theirenv#6176filter_envalso applies to--update-envrestart/reload and to cluster workers;--filter-envalone meanstrue#6176pm2.disconnect()no longer throws nor calls back twice when a socket takes more than 200ms to closepm2 start --containeruseskeymetrics/pm2:<node>-trixie(was the 2018latestimage, and--node-versionpointed to tags that do not exist)
Breaking change
filter_env: trueapps no longer inherit other shell variables (NODE_ENV, NODE_OPTIONS, HTTP_PROXY...): declare them inenv#6176- An app keeps the shell env it already received when the filter comes later (started before 7.1.2 or without
filter_env, dump.pm2 included):pm2 deleteit and start it again #6176
v7.1.1
7.1.1
Bug Fixes
- Windows: memory is reported again when pm2 runs as a service (
pidusage4.1.0, wmic is used again when available) #6173 - Linux: overlapping monitoring calls no longer leak a
/proc/<pid>/statfd per new pid in the daemon (grew with every restart) pm2.connect()right afterpm2.disconnect()no longer crashes withCannot read properties of null (reading 'sock')#6002
v7.1.0
7.1.0
Features
pm2 monit/pm2 dashnow preload the last 200 lines (out + err merged) of every process from
its log files, most recent first;--lines <n>to display more #5187pm2 monit: Ctrl+Up / Ctrl+Down (and PageUp / PageDown) scroll the focused log pane page by page
Bug Fixes
- Shell environment variables named like a PM2 option (
name,namespace,cron_restart,
instances...) no longer override the app configuration #6006 #6016 #5747 #5622 #5030 #5032 #4943
#4778 #4821 #3210 - Variables declared in
env:and named like a PM2 option (env: { port: 3000 },time,
watch...) still reach the app: only the ambient shell environment is filtered, not what the user
declares - Cluster mode: the pid list of the previous kill (
_tree_pids, since 7.0.0) no longer leaks into
the app'sprocess.envafter a restart, nor gets reused as the pid list of a later kill pm2 monit: align the Custom Metrics pane in columns (value right-aligned, fixed unit column,
numbers rounded to 2 decimals) and shorten long metric names instead of pushing values out of the
panepm2 monit: the footer no longer overlaps the bottom border of the Custom Metrics / Metadata
panespm2 monit: logs, metrics and metadata panes update instantly when the selected process changes
(no longer wait for the next refresh tick)pm2 monit: characters of old log lines no longer stay stuck on screen — emoji are now measured
as 2 cells, and\r, cursor escape sequences, control chars and{tags}in logs are sanitized
#5397@pm2/blessedis now vendored inmodules/blessed(one less npm dependency)chokidar3.6.0 is now vendored inmodules/chokidarwith a bounded brace expansion, dropping
the vulnerablebracesdependency (GHSA-vfj7-8cjw-p6xm, no patched version)- Logs: no more lost lines in fork mode with
--time/log_date_formatwhen an app writes more
than 64KB at once (partial line at a pipe chunk boundary was dropped) #6125 - Logs: in cluster mode with
--time, every line of a multi-line write is now date-prefixed (not
only the first) pm2 logs "/regex/" --lines 0now streams matching apps (regex was ignored in stream-only mode);
regexes with an inner/are no longer mangled, apps started afterpm2 logsare picked up, and
only one bus subscription is opened #5196pm2 reloadLogsno longer crashes the app in fork mode whenout_file/error_fileareNULL
and onlylog_fileis set #5509- Logs: log streams are now flushed (
end()) instead of destroyed onpm2 reloadLogs/ app exit,
so buffered data is no longer truncated pm2 serve: a request with a malformed percent-escape (GET /%) no longer crashes the server
(answers 400); handler exceptions answer 500 instead of killing the process- Logs: in cluster mode, output that bypasses
process.stdout.write(pino/sonic-boom,npm start,
children spawned with stdioinherit) no longer ends up inpm2.log— workers get piped stdio and
the daemon routes it to the app log files andpm2 logs#3675 #4719 #4872 #4916 #4953 #5633 #4816 - Logs: in cluster mode, the worker's stdout/stderr pipes are made blocking so a raw write bigger
than the pipe buffer (fs.writeSync(1, ...), native addons) is no longer silently truncated at 64
KB #4044 #4872 exec_mode: clusteron a non Node.js/Bun script (bash, python, binary) now falls back to fork
mode with a warning instead of crashing withSyntaxError: Invalid or unexpected token(ELF) #4775- Node.js/Bun interpreter detection now accepts atypical binary names (
node.exe,node64.exe,
nodejs,node18,node@18,bun.exe), so cluster mode and the fork-mode wrapper are no longer
skipped for them - Restart/stop on systems without
ps(slim Docker images) no longer starts the app twice and
crashes the daemon withCallback was already called#6171 - TreeKill: no
psunder Bun (synchronous spawn throw) falls back to killing the root pid - An online process without a pid (e.g. failed spawn) no longer makes pidusage fail for every app
(One of the pids provided is invalidspam) #6134 #6135 - Cluster mode with
uid/gid: log files created by a root daemon are chowned to the app user (no
more EACCES crash loop) pm2 reloadLogsno longer crashes the daemon (ERR_IPC_CHANNEL_CLOSED) nor leaks fds when a
cluster app is stopped, nor on concurrent calls- Explicit
exec_mode: clusteris kept for JS/TS apps run by a custom interpreter (tsx,
ts-node); fork fallback only for binaries and non-JS scripts/interpreters #4775 pm2 serve: null bytes answer 400 (--spano longer crashes onGET /x/%2500), errors in async
file handlers answer 500- Fork/cluster: log files are closed once the app stdout/stderr pipes are closed, no longer on the
ChildProcessclosethat sometimes never comes on Linux (2 fds leaked per app stop/restart/delete) - Stale
_tree_pidsfrom a 7.0.0-7.0.4 dump no longer leaks into the app env nor gets an unrelated
pid SIGKILLed on stop - PM2.io agent:
PM2_PROXYsupport removed with theproxy-agentdependency (unused, broken since
7.0.0 withProxyAgent is not a constructor; drops the vulnerable get-uri/basic-ftp chain) - Behavior change: shell variables named like a PM2 option (
port,time,watch...) are no
longer forwarded to fork mode apps; declare them inenv: pm2 lshost metrics: virtual interfaces and read-only mounts are hidden
v7.0.4
7.0.4
Features
- Start
.tsapps with Node.js native type stripping when bun is not installed (Node.js >= 22.18 /
23.6,--experimental-strip-typesauto-injected on 22.6+);ts-nodefallback now resolved from the
app's own dependencies
Bug Fixes
- Fix
pm2 start --container/--container --distcrashing withCannot find module— wrong
require depth inContainerizer.jsfrom the v7 promptly internalization - Bump
js-yaml4.3.0 → 4.3.1 - Fix overlapping reloads colliding on the
_old_<pm_id>slot and orphaning a cluster worker — a
reload is now refused while one is in progress #6129 - Ignore stale exit events from a replaced process — fixes double start on Windows with
shutdown_with_message#6142 - Fix
retrying in NaNmskill log and ~1ms poll spam whenkill_retry_timeis unset — fallback to
KILL_RETRY_TIMEconstant (100ms,PM2_KILL_RETRY_TIMEoverridable) - Fix
pm2 start/restartRPC hanging forever when a cluster worker dies before itsonlineevent
(badnode_args, boot OOM) — executeApp now concludes on exit-before-online - Surface the daemon's actual error in CLI output instead of masking everything as
Process not found - Pin OpenTelemetry package versions in
pm2 install-oteland re-emit legacy HTTP span tags
(http.method,http.status_code,http.target) dropped by@opentelemetry/instrumentation-http
= 0.220
Core Refactor
- Remove dead code:
promise.min.jspolyfill (nativePromise),IsAbsolute.js(native
path.isAbsolute), unused Java/Ruby Dockerfile templates, always-falsewin64platform checks
v7.0.3
v7.0.2
7.0.2
Bug Fixes
- Fix
pm2 servereturning 403 Forbidden on Windows — traversal guard used hardcoded/separator #6109 - Fix
pm2 lstable misalignment when a username exceeds theusercolumn width — cli-tableau'struncate()miscounts ANSI bytes, leaking bold into thewatchingcolumn - Fix long status lines (e.g.
Applying action … on app […]) wrapping on narrow terminals —Common.printOutnow ANSI-aware crops single-line TTY output to terminal width (piped output unaffected)
Features
pm2 lshost-metrics line now shown by defaultpm2 update)pm2 lsadaptive layout: picks the widest layout that fits the terminal — full → condensed → new ultra-compactmini(id · name · status · cpu · mem) — and caps thenamecolumn so long names can't overflow the tablepm2 lshost-metrics line only lists network interfaces carrying traffic (hides idle utun/awdl/bridge/anpi/unused en*)pm2 lshost-metrics line: replacedmem freewithram usage(%), added GPU memory/temperature when reported, per-interface network errors/drops shown when non-zero
Core Refactor
- Drop old vizion module, refactor to support only git and drop 3 submodules
- Replace the bundled
pm2-sysmonitmodule andsysteminformationwithlib/tools/SysMetrics.js(Linux/macOS);pm2 slist/getSystemDataand the Docker metrics path now read this collector. Covered bytest/programmatic/sysmetrics.mocha.js
Security
- Bump
js-yaml4.1.1 → 4.3.0 — fixes quadratic-complexity DoS in merge-key handling (GHSA-h67p-54hq-rp68) #6122 - Bump
ws8.20.0 → 8.21.0 — fixes uninitialized-memory disclosure and tiny-fragment DoS (GHSA-58qx-3vcg-4xpx, GHSA-96hv-2xvq-fx4p) #6116 - Bump
@pm2/js-api0.8.0 → 0.8.1, pulling in patchedws@8.21.0(its transitivewswas pinned to the vulnerable 7.x). Production deps are now advisory-free (npm audit --omit=devclean)
v7.0.1
7.0.1
Bug Fixes
- Fix Python (and other non-Node) interpreter regression on Ubuntu: bun runtime detection used a naive
includes('bun')substring check that matched any path containing the letters "bun" — most notably/home/ubuntu/.... Affected paths were routed throughProcessContainerForkBun.jsand crashed withSyntaxError: unterminated string literalwhen Python tried to parse the JS container. Anchored the match to the end of the interpreter path (=== 'bun'or/bun$/) in bothlib/God/ForkMode.jsandlib/Common.js#5990 - Display
max_memory_restartinpm2 describeoutput when set #5925 - Add missing
portoption toStartOptionsTypeScript declaration #6045 - Fix incorrect file permissions on
openrc.tpltemplate (0755 → 0644) #5957 - Fix Windows cmd.exe regression: revert
bin/pm2*launchers to#!/usr/bin/env nodeshebang (was polyglot#!/bin/sh). Polyglot worked on Linux/macOS but broke npm'spm2.cmdshim on Windows —cmd.execan't interpret/bin/shshebang and failed with'"/bin/sh"' is not recognized as an internal or external command. PowerShell's auto-generatedpm2.ps1shim happened to callnodedirectly so it kept working, masking the regression. Bun-only Linux/macOS users (no Node installed) need to symlinknodetobun(sudo ln -s $(which bun) /usr/local/bin/node) — same workaround used in the project's bun test Dockerfile. Documented in README #6108
v7.0.0
7.0.0
Breaking Changes
- Require Node.js >= 18.0.0 (dropped Node.js 16 support)
Core Refactor
- Internalize pm2-axon, pm2-axon-rpc, pm2-io-bpm, pm2-io-agent, fclone as local modules (reduced supply chain surface)
- Internalize pm2-multimeter and charm into lib/tools/multimeter (zero external deps)
- Add Bun runtime support (ProcessContainerBun.js, ProcessContainerForkBun.js)
- Replace
needlewith nativefetch(CliAuth, TAR publish) - Replace
enquirerwith lightweight built-in prompt (boilerplate selector) - Replace
promptlywith built-in lib/tools/prompt - Replace
mkdirpwith nativefs.mkdirSync({ recursive: true }) - Replace
source-map-supportwith nativeprocess.setSourceMapsEnabled() - Replace
sprintf-jswith template literals (Dashboard) - Replace
url.parse()with nativeURLconstructor (Serve, Utility, CliAuth) - Remove
fclonenpm dep, use internalized module - Drop auto source map file detection in Common.prepareAppConf
Security
- CVE-2025-5891 Fix ReDoS in Config.js string-to-array split regex #6075
- CVE-2026-27699 Update proxy-agent to 6.5.0, basic-ftp to 5.3.1 #6088
- Fix command injection in WebAuth.js open() — replace exec() with execFile() #6089
- Fix command injection in PM2IO.js open() — replace exec() with execFile(), validate SUDO_USER
- Fix command injection in lib/tools/open.js — replace exec() with execFile(), validate SUDO_USER
- Fix prototype pollution in Configuration.set/unset via proto key traversal #6089
- Fix HttpInterface env stripping never executing (WEB_STRIP_ENV_VARS) #6089
Bug Fixes
- Rewrite TreeKill: single ps snapshot + in-memory tree build, eliminates race conditions. SIGKILL escalation now targets surviving child processes directly instead of re-walking a dead tree #6084
- Fix [object Object] env vars leaked to fork mode subprocesses #6073
- Fix Windows home path: use os.homedir() instead of HOMEPATH/HOMEDRIVE env vars #6106
- Fix Windows TreeKill callback consistency
- Fix missing BPM monitoring injection in Bun cluster mode (ProcessContainerBun.js)
- Fix ReferenceError crash in Bun cluster console overrides when disable_logs is true
- Fix CliAuth wrong credentials error displaying "undefined" instead of error message
Features
- Add
--ftpoption topm2 servefor directory listing (python http.server style)
Dependencies
- Add OpenTelemetry tracing as direct dependencies (@opentelemetry/api, sdk-node, auto-instrumentations-node)
- Upgrade OpenTelemetry packages to latest
- Update pidusage from 3.0.2 to 4.0.1
- Upgrade ws to ^8.18.0, eventemitter2 to ^6.4.9
- Remove needle, enquirer, promptly, mkdirp, source-map-support, sprintf-js, fclone from npm dependencies
Testing
- Add Docker parallel test runner with Node.js and Bun support
- Add Windows test suite (test/windows.sh)
- Add OpenTelemetry tracing tests
- Add TreeKill unit tests
- Add test scripts for internalized modules (bpm, axon, axon-rpc, io-agent)
- Fix test compatibility for Node.js 22+ and Bun
- CI matrix: Node.js 18, 20 + latest