Check your Node version from the command line
The fastest way to see which version of Node.js is installed on your machine is to open a terminal or command prompt and run a single command. Node stores version information that you can retrieve in seconds, whether you are on Windows, macOS, or Linux.
Open your terminal or command prompt and type this:
node --version
Press Enter. The output will show something like v18.12.0 or v20.9.0 — the v stands for version, and the numbers that follow tell you exactly which release you have. You can also use node -v as a shorthand; both commands do the same thing.
If you see an error message like "command not found" or "'node' is not recognized", Node.js is not installed on your system or is not in your system's PATH — the list of locations your computer checks when you type a command.
Key Takeaways
- Run node --version or node -v in your terminal to see your installed Node.js version instantly.
- The version number tells you the major release (the first digit), minor updates (the second digit), and patch fixes (the third digit).
- If the command does not work, Node.js is either not installed or not accessible from your current terminal location.
- You can also check the npm version separately with npm --version, since npm (Node Package Manager) comes bundled with Node but has its own version number.
Understanding version numbers
Node version numbers follow a pattern called semantic versioning, written as three numbers separated by dots: major.minor.patch. A version like v18.12.0 breaks down as major version 18, minor version 12, and patch version 0.
The major version (the first number) changes when Node introduces breaking changes — updates that might stop old code from working the way it did before. Minor versions add new features without breaking existing code. Patch versions fix bugs and security issues without adding features.
Knowing your version matters because some packages and tools require a minimum Node version to run. If a package says it needs Node 16 or higher and you have Node 14, you will run into errors when you try to use it.
Check npm version at the same time
npm (Node Package Manager) comes bundled with Node.js, but it has its own separate version number. You might need to know both — some projects specify which npm version they need, separate from the Node requirement.
To check your npm version, run:
npm --version or npm -v
This shows you the npm version independently. npm updates more frequently than Node itself, so you might have a newer npm version even if you have not updated Node in a while.
Find version information in your code
If you are writing a Node.js script and need to check the version programmatically — meaning your code checks it rather than you typing a command — you can access it through the process.version property.
Create a file called check-version.js and add this line:
console.log(process.version);
Then run it with node check-version.js. The output will print your Node version the same way the command-line check does. This is useful when you are building tools or scripts that need to verify Node compatibility before running.
What to do if Node is not installed
If the node --version command returns an error, Node.js is not installed. You will need to download and install it from the official Node.js website before you can use Node or npm.
After installation, close your terminal completely and open a new one. The new terminal will recognize the Node command. If you still get an error after a fresh terminal, the installer may not have added Node to your system PATH correctly — you may need to reinstall or adjust your system settings.
Check Node version on different operating systems
The command node --version works the same way on Windows, macOS, and Linux. The only difference is how you open the terminal: on Windows you use Command Prompt or PowerShell, on macOS you use Terminal, and on Linux you use your distribution's terminal application.
Some Windows users may need to use PowerShell instead of Command Prompt if the regular command prompt does not recognize the node command. PowerShell is more modern and often has better access to installed programs.
If you installed Node through a package manager on Linux (like apt, brew, or yum), the version check command remains identical — open your terminal and type node --version.
Frequently Asked Questions
Why do I need to know my Node version?
Many npm packages specify a minimum Node version they require to work. If your Node version is too old, the package will not install or will not run correctly. Knowing your version helps you decide whether to update Node or find an older version of the package that supports your current setup.
Can I have multiple Node versions installed at once?
Yes, using a version manager like nvm (Node Version Manager) on macOS and Linux, or nvm-windows on Windows. A version manager lets you install multiple Node versions and switch between them for different projects. You check which version is currently active with node --version.
What is the difference between LTS and current versions?
LTS (Long Term Support) versions receive security updates for several years and are recommended for production use. Current versions have the newest features but only receive updates for a few months. Your node --version output does not tell you which type you have — you can check the Node.js website to see if your version number is listed as LTS or current.
Should I update Node if I have an older version?
If your current projects work and do not require a newer version, updating is optional. However, older versions eventually stop receiving security updates, so updating to an LTS version is a good idea for long-term projects. Check your package documentation first to see what Node versions it supports.