Skip to content
FLAVIO COPES
flaviocopes.com
2026

How to check the current Node.js version at runtime

By Flavio Copes

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.

~~~

Run process.version:

Terminal showing process.version command returning v12.13.0

The version property of the process object returns a string with the current Node.js version.

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

Browser console showing ReferenceError: process is not defined

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

Terminal output showing process.versions object with node, v8, uv, zlib and other component versions

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

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

Terminal showing process.versions.node returning 12.13.0 and split method extracting major version 12

Tagged: Node.js · All topics
~~~

Related posts about node: