The three ways to check your Node version

The fastest way to check your Node version is to open your terminal or command prompt and type node --version or node -v. Both commands do the same thing and will print the version number on the next line — for example, v18.12.0 or v20.9.0.

If you want to see more detail about your Node installation, you can type node --help to see all available commands, or npm --version to check the version of npm (Node Package Manager) that came with your Node installation. npm is the tool that manages code libraries and dependencies for Node projects.

On Windows, you can also right-click the Node.js icon in your Start menu and select "Properties" to see version information, though the command line method is faster and works the same way on Windows, Mac, and Linux.

Key Takeaways

  • Type node -v in your terminal to see your Node version when ready — this is the fastest method on any operating system.
  • The version number appears on the next line after you run the command, in the format v[major].[minor].[patch], like v18.12.0.
  • If the command returns "command not found" or similar, Node is not installed or not in your system path, and you will need to install it first.
  • npm (the package manager that comes with Node) has its own version number, which you can check separately with npm -v.

Why knowing your Node version matters

Different projects require different versions of Node because features, security fixes, and how the language works can change between versions. A project built for Node 16 might not run correctly on Node 14, or it might run but behave differently. When you join a team or read someone else's project, the first thing to check is whether your Node version matches what the project expects.

Many projects include a file called .nvmrc or a note in the README that specifies which Node version to use. Knowing how to check your current version lets you see whether you need to switch to a different one before you start work.

What to do if your version does not match what you need

If your Node version is too old or too new for a project, you have two main options. The simplest is to read and install the version you need from nodejs.org, which will replace your current installation. This works fine if you only work on one project at a time.

If you work on multiple projects that need different Node versions, use a version manager like nvm (Node Version Manager) on Mac or Linux, or nvm-windows on Windows. A version manager lets you install multiple Node versions and switch between them with a single command. For example, nvm use 18.12.0 switches to that version, and nvm use 20.9.0 switches to another. This saves you from reinstalling Node every time you change projects.

Reading the version number format

Node version numbers follow a pattern called semantic versioning, written as major.minor.patch. In v18.12.0, the 18 is the major version, 12 is the minor version, and 0 is the patch version.

Major versions (like 18 or 20) contain big changes and sometimes break how old code works. Minor versions (like the 12 in 18.12) add new features but keep old code working. Patch versions (like the 0 in 18.12.0) fix bugs without changing how anything works. When someone says "you need Node 18", they usually mean any version starting with 18 — so 18.0.0, 18.12.0, or 18.15.3 would all work.

Checking Node version in a running project

If you are already working inside a Node project and want to confirm the version without opening a new terminal window, you can check the package.json file in your project folder. Look for a field called "engines" — if it exists, it will tell you which Node versions the project supports. For example: "engines": { "node": ">=18.0.0" } means the project needs Node 18 or newer.

You can also type node -e "console.log(process.version)" inside your project folder to print the version without leaving your editor or IDE. This is useful if you want to verify the version while you are actively coding.

Troubleshooting when the command does not work

If you type node -v and get an error like "command not found" or "'node' is not recognized", Node is either not installed or your computer cannot find it. On Windows, try restarting your terminal or command prompt after installing Node — sometimes the system path does not update until you close and reopen the window.

On Mac or Linux, if you installed Node using a version manager like nvm, make sure you have run the setup commands from the nvm installation guide. These commands tell your terminal where to find Node. If you installed Node directly from nodejs.org and still get an error, reinstall it and choose the option to add Node to your system path during installation.

Frequently Asked Questions

What is the difference between node -v and node --version?

They do exactly the same thing. -v is the short form and --version is the long form. Use whichever you prefer — both print your Node version when ready.

Can I have two different Node versions installed at the same time?

Not in the traditional sense — installing a new version usually replaces the old one. However, a version manager like nvm lets you install multiple versions and switch between them. This is the standard approach for developers who work on projects with different Node requirements.

Does npm version need to match Node version?

No. npm comes bundled with Node, and each Node version includes a specific npm version. When you update Node, npm updates automatically. You do not need to match them manually — they are tied together.

What Node version should I use for a new project?

Use the latest Long Term Support (LTS) version, which you can find on nodejs.org. LTS versions receive security updates for years and are stable for production work. Avoid very new versions unless you need a specific feature, because they may have bugs that get fixed in later releases.

How do I know if my Node version is too old?

Check the project's README or package.json file for the required Node version. If your version is lower than what the project needs, you will see errors when you try to run the code. The error message usually tells you which version is required.