What Is New in Node.js 17?
| Category | Change |
|---|---|
| New Features | OpenSSL 3.0 (first Node.js version to ship it) |
| New Features | readline/promises -- promise-based readline API |
| Improvements | V8 9.5 -- Error.cause, new Intl APIs |
| Improvements | DNS results returned in order of query again (reverts v17 interim change) |
| Improvements | --no-experimental-fetch flag to disable fetch preview |
| Security | OpenSSL 3.0 with improved FIPS support |
OpenSSL 3.0 -- The First Node.js Release to Ship It
Node.js 17 is the first release line to bundle OpenSSL 3.0, a significant security milestone. OpenSSL 3.0 brings improved FIPS 140-2 support, a provider model for algorithm implementations, and deprecation of legacy ciphers.
This introduced some compatibility breakage for apps using older cipher suites or PKCS#11 backends. If your app is crypto-heavy, test thoroughly on Node.js 17 before upgrading from Node.js 16.
readline/promises -- Async/Await for CLI Input
The new readline/promises API replaces event-driven readline patterns with clean async/await syntax. Useful for interactive CLI tools and scripting.
import { createInterface } from 'node:readline/promises';
const rl = createInterface({ input: process.stdin, output: process.stdout });
const answer = await rl.question('What is your name? ');
console.log(`Hello, ${answer}`);
rl.close();
No more nested callbacks or event listener juggling for simple interactive prompts.
Error.cause and V8 9.5 JavaScript Features
Error.cause allows chaining errors with original context, a pattern widely used in languages like Java and Python that finally lands natively in JavaScript.
async function fetchData(url) {
try {
return await fetch(url);
} catch (err) {
throw new Error(`Failed fetching ${url}`, { cause: err });
}
}
The cause is preserved in the error chain and shows up in stack traces, making debugging async code significantly cleaner.
DNS Resolver Behavior Change
Node.js 17 initially changed DNS result ordering in a way that broke some apps, then partially reverted. The net result: DNS queries now use the system resolver order. If your app had relied on a specific ordering of returned addresses, verify this behavior in your target environment.
FAQ
Why does my crypto code break on Node.js 17?
OpenSSL 3.0 disables some older algorithms and cipher suites by default. Check if you are using MD4, RC4, or short RSA keys -- these may now require explicit enablement via a legacy provider.
Is Node.js 17 an LTS release?
No. Node.js 17 is a Current release. It reached end-of-life in June 2022. The concurrent LTS was Node.js 16.
How does readline/promises compare to the inquirer package?readline/promises is low-level -- basic line input. For rich interactive prompts with menus, validation, and formatting, inquirer or @inquirer/prompts is still the better choice.
Does the OpenSSL 3.0 FIPS mode work out of the box?
Not automatically. FIPS mode requires explicit configuration -- you need a FIPS-validated OpenSSL provider installed and --enable-fips passed at startup, or set via crypto.setFips(true).
Can I still use node:readline (non-promises) in Node.js 17?
Yes. The callback-based node:readline API is not removed. readline/promises is an additive module alongside the existing API.