Just a few weeks until the 2021 JavaScript Full-Stack Bootcamp opens.
Signup to the waiting list!

Run process.version:

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:

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

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


Download my free Node.js Handbook

The 2021 JavaScript Full-Stack Bootcamp will start at the end of March 2021. Don't miss this opportunity, signup to the waiting list!

More node tutorials: