---
title: "Node.js v14: What's New?"
description: "Let's dive into the updates that Node.js version 14 gives us!"
authors:
  - name: "Kapehe Jorgenson"
    url: "https://auth0.com/blog/authors/kapehe-jorgenson/"
date: "May 4, 2020"
category: "Developers,Whats New,Node.js"
tags: ["node", "nodejs", "version", "update"]
url: "https://auth0.com/blog/nodejs-v-14-whats-new/"
---

# Node.js v14: What's New?



That's right! Node.js version 14 is here! 🎉

Whether you have upgraded your Node version already or are thinking about doing it soon, let's discuss some of the things that this new version gives us! We'll even chat about older versions and what to expect there in the coming months.

<AmpContent>
    <amp-twitter width="375"
      height="472"
      layout="responsive"
      data-tweetid="1252616090422775809">
    </amp-twitter>

</AmpContent>

<NonAmpContent>

  <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Node.js v 14 is here! 🎉💚 <a href="https://t.co/iB7dK5uljY">https://t.co/iB7dK5uljY</a></p>&mdash; Node.js (@nodejs) <a href="https://twitter.com/nodejs/status/1252616090422775809?ref_src=twsrc%5Etfw">April 21, 2020</a></blockquote> 
  <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

</NonAmpContent>

## How to Upgrade

Want to upgrade your current Node.js version? Following the instructions [here](https://nodejs.org/en/download/current/) to download for any operating system: macOS, Windows, and Linux. We will find that Node.js 14.0.0 includes npm 6.14.4.

## What's New?

There are many things to look forward to with this major release. Some of the new features include:

1. The once experimental feature, Diagnostic Reporting, is now stable!
2. V8 has been upgraded to V8 8.1
3. Node Streams have been updated
4. Removal of Experimental Modules Warning

Let's walk through these!

To find the full list of changes, you can [visit this page](https://nodejs.org/en/blog/release/v14.0.0/). 

<include src="TweetQuote" quoteText="That's right! Node.js version 14 is here! 🎉"/>

### Diagnostic Reporting is now stable!

Diagnostic reporting generates a JSON-formatted file that can aid in diagnosing problems. When things go wrong in your app, like slow performance or memory leaks, it's helpful to have a full report on where issues are occurring. Even if our app were to crash, this report would have information on that as well. We can run this report in development, testing, or production.

Back when Node.js v12 was released, [diagnostic reporting](https://nodejs.org/api/report.html) was experimental. We now have it as a stable feature in this new version. 

To run the report, run the following in your command line:

```bash
node --report-uncaught-exception --report-on-signal \
--report-on-fatalerror app.js
```

Let's break down this command:

* `--report-uncaught-exception`: The report will generate on uncaught exceptions. We want to make sure all errors are caught and handled.
* `--report-on-signal`: This will allow for reports to be generated when a specific signal is sent to the Node.js process.
* `--report-on-fatalerror`: Reports all the fatal errors. It lets us know of all the errors that would cause our js applications to stop working.
* `app.js`: Where we are running the diagnostic report.

> There are many different variations to this command. Visit [this page](https://nodejs.org/api/report.html) for the official docs on diagnostic reporting in Node.js and other ways to use the command.

<include src="TweetQuote" quoteText="Diagnostic Reporting is now stable in Node.js v14!"/>

### V8 upgraded to v8.1

This Node.js v14.x release also comes with the newly upgraded [Javascript engine: v8.1](https://v8.dev/blog/v8-release-81)!

There are a handful of things that were added into this version; one that we'll cover here is the [nullish coalescing operator](https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_Coalescing_Operator).

The nullish coalescing operator looks like this: `??`. The operator returns the results of the expression to the right of the operator only when the expression to the left of it is `null` or `undefined`. Otherwise, the results from the left expression are returned. Let's see that in action:

```javascript
const newVersion = null ?? 'Does this work?';
console.log(newVersion);
// expected output: "Does this work?"

const nullishTest = 0 ?? 55;
console.log(nullishTest);
// expected output: 0
```

The value on the left-hand has to be `null` or `undefined` for the right-hand value to be ran. So in the second example, it was a `0` on the left; because that is not `null` or `undefined`, it returned with the `0` number.

This helps a lot with values that are returned `null` or `undefined` when we were not expecting them to do so. So if something happens in our app and it returns `null`, the operator moves on to maybe an error message or a default value (the value on the right-hand side of the operand) and gives the user something to see.

Some other things that are in v8.1 include:

* [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining)
* [Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
* [Enables calendar and numberingSystem options for Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat)

### Streams

Streams can help with many things in Node, here are a few:

* Handling data
* Handling writing/reading files
* Network communication

Streams have not been recently added (they've been around for a while), but consistency has improved. [Some examples that were mentioned](https://medium.com/@nodejs/node-js-version-14-available-now-8170d384567e#4f1c) were:

* `http.OutgoingMessage` is similar to `stream.Writable`. To learn more about `stream.Writable`, visit [this docs page](https://nodejs.org/api/stream.html#stream_class_stream_writable).
* `net.Socket` behaves exactly like `stream.Duplex`. To learn more about `stream.Duplex`, visit [this docs page](https://nodejs.org/api/stream.html#stream_class_stream_duplex).

A [blog post by Michael Dawson and Bethany Griggs recommends](https://medium.com/@nodejs/node-js-version-14-available-now-8170d384567e#4f1c) that if your application relies heavily on streams, start testing now! This will help us get ready for the Node.js v14 LTS release in October 2020.

The full stream module official documentation can be found [here](https://nodejs.org/api/stream.html).

### Removal of Experimental Modules Warning

When running an ECMAScript Modules (ESM) in Node.js, we would get an "Experimental Warning". That warning has now been removed. That's it! It's still experimental, the warning has just been removed. 

![GitHub view of warning text being removed](https://images.ctfassets.net/23aumh6u8s0i/2gZ5cHBFGnWCndRMuCjrZQ/3c5129df9fd6b9394f8d69e4bcb7f064/experimental-modules-warning)
([Source](https://github.com/nodejs/node/commit/22b6997abae339202d77877368f50ae52b890c44))

ESM is JavaScript's standard module system. It helps with managing variables, organizing functions, and grouping things that would make sense in our code. To learn more about this feature, check out [the official documentation](https://nodejs.org/api/esm.html).

ESM is the best module format thanks to its simple syntax, async nature, and tree-shakeability.

## Experimental Additions

In this version update, we see a couple of experimental additions. Those include:

1. [Experimental Async Local Storage API](https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage)
2. [Experimental Web Assembly System Interface](https://nodejs.org/api/wasi.html)

Head on over to the [official Node.js v14 docs](https://nodejs.org/api/) to find out all the updates and experiments! 

## What About Older Versions?

Nervous about what is going to happen to your older versioning? Not ready to upgrade just yet? The older versions will lose their support soon, but we've got time! The LTS version release status is "long-term support", which typically guarantees that critical bugs will be fixed for a total of 30 months.

We can see the support and release line here:

![Current release schedule](https://images.ctfassets.net/23aumh6u8s0i/77cPUuzd0qRGBtZCPHrqSm/e99ec8aab7ac969895cd2b0f9d263ef3/release-timeline)
([Source](https://nodejs.org/en/about/releases/))

<include src="asides/Node" />

## Conclusion

This Node.js release is exciting, and after looking at some of the new updates, I'm super excited to try it! Let me know if you have updated your Node.js version and what you think of version 14. 

---
