How to check versions of Node and Express using cmd

Key takeaways:

  • Use node -v or node --version in the terminal to verify the installed Node.js version.

  • Use npm -v or npm --version to verify the installed npm version.

  • Navigate to your project directory and use npm list express to check the Express.js version installed in your project.

Ensuring we’re using the correct versions of our tools and libraries in web development is crucial for compatibility and functionality. Node.js and Express.js are two fundamental tools for building server-side applications in JavaScript. Here, we’ll explore various methods to check the versions of Node.js and Express.js using the terminalThe terminal is a text-based interface in Unix-like systems (Linux, macOS) that provides access to a shell like Bash or Zsh, allowing users to execute commands and scripts. Command Prompt (cmd) is the command-line interface for Windows, offering a similar text-based interface but with a different set of commands and syntax, more limited compared to Unix-like shells..

Node.js

Node.js is a cross-platform JavaScript runtime environment that executes JavaScript code outside a web browser. It is designed to build scalable network applications. Node.js uses an event-driven, non-blocking I/O model, making it lightweight and efficient. It’s built on Chrome’s V8 JavaScript engine, which provides high performance.

Express.js

Express.js, or simply Express, is a web application framework for Node.js. It is designed to build web applications and APIs. Express provides a robust set of features to develop both web and mobile applications. It simplifies the process of building server-side logic and handling HTTP requests and responses, making it a popular choice among developers for building web applications.

Before we begin, make sure we’ve installed Node.js on our system. If not, we can follow the installation guides for Node.js.

Checking Node.js version

Checking the version of Node.js installed on our system is straightforward. We can use the node command followed by the -v or --version flag. This command works across different operating systems, including Windows, macOS, and Linux.

node -v
node --version
Commands for checking Node.js version

The output will display the version number of Node.js installed on our system, such as v22.3.0.

Checking npm version

Node.js comes with npm (Node Package Manager), which is essential for managing packages in our Node.js projects. We might also want to check the npm version to ensure compatibility. Type one of the following commands in the terminal to check the npm version.

npm -v
npm --version
Commands for checking npm version

The output will display the version number of npm installed on your system, such as 10.8.1.

Checking Express.js version

Express.js is typically installed locally within a Node.js project. To check the version of Express.js, we need to navigate to our project directory and use npm commands to retrieve the version information.

Use the cd command to navigate to the root directory of our Node.js project where Express.js is installed. For testing purposes, here we have added a trivia-game project. Use the following commands in the terminal to check the version of Express.

npm list express
Command for checking express version

The output will display the version number of Express.js installed in our project.

Try it yourself

Press “Click to Connect” in the following to launch the terminal. Type the commands above in the following terminal and press the “Enter” key:

Terminal 1
Terminal
Loading...

Conclusion

Checking the versions of Node.js and Express.js using the terminal is a fundamental task for ensuring compatibility and functionality in our web development projects. We provided step-by-step instructions for checking the versions of these essential tools and troubleshooting common issues.

By regularly checking and updating the versions of Node.js and Express.js, we can take advantage of the latest features, performance improvements, and security patches. Whether you’re a beginner or an experienced developer, maintaining up-to-date versions of our development tools is a best practice that contributes to the overall success of our projects.

Frequently asked questions

Haven’t found what you were looking for? Contact Us


How can we check the node version in cmd?

Use npm -v or npm --version.


Why am I getting an error when I run node -v?

Possible issues include Node.js not being installed or the command not being recognized due to incorrect PATH settings.



Free Resources

Copyright ©2025 Educative, Inc. All rights reserved