What Is New in Node.js 16?
| Category | Change |
|---|---|
| New Features | V8 9.0 -- RegExp match indices, Atomics.waitAsync |
| New Features | npm 7 included (workspaces support) |
| New Features | Stable timers/promises API |
| Improvements | Apple Silicon (M1) prebuilt binaries |
| Improvements | AbortController and AbortSignal globally available |
| Improvements | DNS: verbatim option for system resolver order |
| Security | OpenSSL 1.1.1 (switches to 3.0 in 17) |
| Deprecated | process.binding() stabilization curtailed |
Apple Silicon Support -- Native M1 Binaries
Node.js 16 ships prebuilt binaries for Apple Silicon (arm64). Prior to this, M1 Mac users ran Node.js under Rosetta 2, which worked but had performance overhead. Native arm64 binaries eliminate that translation layer.
If you install Node.js via nvm or a Node version manager, make sure your version manager itself is running natively (arm64) -- otherwise it may install the wrong architecture binary.
npm 7 and Workspaces
Node.js 16 bundles npm 7, which introduces workspaces -- a first-class monorepo feature. You can define multiple packages in a single repository and run commands across all of them.
// package.json
{
"workspaces": ["packages/*"]
}
// npm install at root now links all workspace packages
npm 7 also automatically installs peer dependencies, which is a behavior change from npm 6. This can cause install failures if peer dependency requirements in your dependency tree conflict.
Stable timers/promises and AbortController
The timers/promises module stabilizes in Node.js 16, providing promise-based setTimeout, setInterval, and setImmediate.
import { setTimeout } from 'node:timers/promises';
await setTimeout(1000);
console.log('1 second elapsed');
AbortController and AbortSignal are now globally available without import, matching the browser API. You can cancel fetch requests, timers, and other async operations using a single abort controller.
RegExp Match Indices (d flag)
V8 9.0 adds the d flag to regular expressions, which records start and end indices of each match. Useful for syntax highlighters, parsers, and code analysis tools.
const re = /foo/d;
const match = re.exec('foobar');
console.log(match.indices[0]); // [0, 3]
FAQ
Is Node.js 16 an LTS release?
Yes. Node.js 16 (codename "Gallium") is an LTS release. Its support ended in September 2023 -- earlier than planned because OpenSSL 1.1.1 itself reached end-of-life.
Why did npm 7 break my install?
Automatic peer dependency installation changed the resolution algorithm. If you see ERESOLVE errors, use npm install --legacy-peer-deps temporarily while you update conflicting packages.
Does AbortSignal work with Node.js streams?
Yes, from Node.js 16 onwards streams accept an AbortSignal option to cancel streaming operations cleanly without destroying the stream listener manually.
What happened to the AbortController timeout shorthand?AbortSignal.timeout(ms) was added in Node.js 17, not 16. In v16 you'd manually call abort() after a delay.
Can I run native arm64 and x64 Node.js side-by-side on Apple Silicon?
Yes, using different shell environments (native Terminal vs Rosetta Terminal) or with nvm's architecture flags. Tools like nvm support --default-packages per arch profile.