docs/supporting-a-new-node-version.md
These steps are only relevant to Sentry employees when adding support for a Node.js verison.
Adding support for a new Node version touches three repos. Because native modules ship precompiled binaries that must be rebuilt for the new Node ABI, the native module repos must be released first, then we bump to the new versions of those in this repo and add the new Node version to the CI matrix.
The order is:
The Node.js 26 rollout is a good reference:
Native addons are compiled against a specific Node.js ABI version
(also called NODE_MODULE_VERSION), not the Node major version. Each Node major maps to one ABI:
| Node major | ABI |
|---|---|
| 18 | 108 |
| 20 | 115 |
| 22 | 127 |
| 24 | 137 |
| 26 | 147 |
You can look up the ABI for a new release at https://nodejs.org/en/download/releases or by running node -p process.versions.modules
on the new version.
You'll need this number throughout, binaries are named after it
(e.g. linux-x64-glibc-147) for Node 26.
Repo: sentry-javascript-profiling-node-binaries
Reference PR: #32
Add the build matrix entries. In .github/workflows/build.yml, add a new matrix entry for
the new Node version + ABI for every target platform:
linux-x64-glibclinux-x64-musl,linux-arm64-glibclinux-arm64-musldarwin-x64,darwin-arm64,win32-x64The binary key follows the <platform>-<abi> naming convention (e.g. linux-x64-glibc-147).
node:26-alpine3.22).<source_location>, which the default compiler in the ubuntu-20.04 glibc
container is too old to build. A dedicated step upgrades just that target to gcc-12/g++-12
(via ppa:ubuntu-toolchain-r/test). Watch for similar issues on future versions.Add the runtime ABI resolution. In src/index.ts, add an if (abi === '<new-abi>') branch
for each platform that requires the new .node binary
(e.g. sentry_cpu_profiler-linux-x64-glibc-147.node).
Release a new version via Craft and note the version number for Step 3.
Repo: sentry-javascript-node-native-stacktrace
Reference PR: #38
This mirrors Step 1 exactly — same matrix additions, same compiler caveat, same src/index.ts ABI
branches (here the binaries are named stack-trace-<platform>-<abi>.node).
.github/workflows/ci.yml for all platforms.if (abi === '<new-abi>') resolution branches in src/index.ts.Repo: sentry-javascript
Reference: #20710
Add the version to the CI test matrix in .github/workflows/build.yml to every node: [18, 20, 22, 24] entry.
Bump the native module dependencies to the versions released in Steps 1 and 2:
@sentry-internal/node-cpu-profiler in packages/profiling-node@sentry-internal/node-native-stacktrace in packages/node-native/package.jsonyarn install to update yarn.lockRegister the new ABI in the profiling pruner. In
packages/profiling-node/scripts/prune-profiler-binaries.js:
NODE_TO_ABI object (e.g. 26: '147').else if (NODE.startsWith('26')) branch.Allow the new major in the profiling integration, in packages/profiling-node/src/integration.ts:
if (![16, 18, 20, 22, 24, 26].includes(NODE_MAJOR)) guardconsole.warn message below the guard (the string that reads ...prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22, 24.)Handle deprecation warnings. Each new Node version tends to deprecate APIs the SDK (or its dependencies) still use, which can break tests that assert on clean stderr or console output.
Fix version-specific test failures, some integrations or test dependencies may not yet work on the new version.