How to Check the Installed Node.js Version
Node.js is an open-source server-side JavaScript runtime environment built on Chrome’s V8 JavaScript engine. Node.js is suitable for creating scripts that generate and render dynamic content and also read, open and close files on the server.
Node.js follows the event-driven architecture. It is also nonblocking, asynchronous, and lightweight, making it suitable for creating event-driven applications. Furthermore, Node.js is also cross-platform, single-threaded, and memory efficient.
Node.js can be downloaded from its official website nodejs.org.
Irrespective of the underlying operating system running the Node.js .msi installer is a straightforward process that involves accepting the terms and conditions and clicking Next a couple of times before clicking Install. Installing Node.js on windows requires that we have administrator privileges.
Using the terminal or command prompt in the respective operating system, we can verify that Node.js has been successfully installed by running the command below.
C:\Users>node -v
Sample output:
v16.13.1// Version - v16.13.1 was the most current LTS release at the time of writing this article.
Running the command below will equally return the current version of Node.js installed in your system.
node --version
Sample output:
v16.13.1
Node.js is bundled with the latest version of npm, and therefore having installed Node.js, we have also installed the Node Package Manager. NPM is the world’s largest software registry that allows developers to publish and share useful packages.
At the time of writing this article, the Node.js download included npm 8.1.2. We can verify the version of npm installed alongside Node.js by running the command below in the terminal or PowerShell.
C:\Users>npm -v
Sample output:
8.1.2
We can use the Node Package Manager to determine the version of Nodejs that is installed in the system by running the command below in the command prompt.
C:\Users>npm -v nodejs
Sample output:
8.1.2
Alternatively, the command below can be used in the terminal or command line when npm is installed to determine the current version of Node.js installed in the system.
C:\Users\DelftStack>npm --v nodejs
Sample output:
8.1.2
Like Python, Node.js also has a REPL ( read, evaluate, print, loop ) virtual environment to execute and test simple tasks in Node.js and JavaScript. To launch the Node REPL we can simply do so by typing the word node on the command line. By doing so, we enter into this Node.js interactive environment and determine the version of Node.js that we are currently running.
C:\Users>node
Sample output:
Welcome to Node.js v16.13.1.
Type ".help" for more information.
>
Isaac Tony is a professional software developer and technical writer fascinated by Tech and productivity. He helps large technical organizations communicate their message clearly through writing.
LinkedIn