# How to check the current Node.js version at runtime

> Learn how to check the current Node.js version at runtime with process.version, and how to read the major version number from the process.versions object.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-06-09 | Topics: [Node.js](https://flaviocopes.com/tags/node/) | Canonical: https://flaviocopes.com/node-version-runtime/

Run `process.version`:

![Terminal showing process.version command returning v12.13.0](https://flaviocopes.com/images/node-version-runtime/Screen_Shot_2020-06-05_at_20.40.15.png)

The `version` property of the `process` object returns a string with the current [Node.js](https://flaviocopes.com/nodejs/) version.

In the browser the `process` object is not defined, so you will get a ReferenceError:

![Browser console showing ReferenceError: process is not defined](https://flaviocopes.com/images/node-version-runtime/Screen_Shot_2020-06-05_at_20.41.10.png)

Another way is to reference `process.versions` (plural):

![Terminal output showing process.versions object with node, v8, uv, zlib and other component versions](https://flaviocopes.com/images/node-version-runtime/Screen_Shot_2020-06-05_at_20.41.50.png)

This returns an object that contains various properties referencing each component's version.

To get the major version (in this example `12`) you can use

```js
process.versions.node.split('.')[0]
```

![Terminal showing process.versions.node returning 12.13.0 and split method extracting major version 12](https://flaviocopes.com/images/node-version-runtime/Screen_Shot_2020-06-05_at_20.43.18.png)

If you're checking the version to know whether a feature is available, my free [Node versions tool](https://flaviocopes.com/tools/node-versions/) tells you which feature shipped in which Node.js version.
