To check your Node.js version, open a terminal and run node --version. To check npm, run npm --version. Both print a single line: node --version shows something like v22.11.0, and npm --version shows the bundled npm, something like 10.9.0. That is the whole answer for most people. The interesting part is everything around it: which Node install actually answered (you may have several), how to read the version from inside a script, and why node -v and your version manager sometimes disagree. I have spent more time than I would like debugging a CI job that ran a different Node than the one I checked by hand, so the "which install is on PATH" section below is the one I would not skip.
Latest release with newest features. Best for experimentation.
Long-Term Support — the version to use in production.
How do I check my Node.js version?
Run node --version (or the short form node -v) in any terminal. It prints the active version with a leading v:
node --version
# v22.11.0
node -v
# v22.11.0For npm, run npm --version or npm -v:
npm --version
# 10.9.0If either command prints command not found (Linux/macOS) or is not recognized (Windows), Node is not installed or not on your PATH. See installing Node for that case. If the version is older than you expected, see updating Node.
Jump to:
- node --version vs node -v
- Check the npm version
- Which Node is actually running (PATH)
- Read the version inside a script
- Check the version a project expects
- Version managers: nvm, fnm, Volta
- Checking on Windows
- FAQ
node --version vs node -v
They are identical. node --version and node -v both print the version string and exit; -v is just the short alias. Either works in every Node release since the beginning. I use node -v interactively and node --version in scripts and docs because the long form reads clearly to someone who has never seen it.
The output is the semantic version of the running binary, prefixed with v:
node -v
# v22.11.0
# ^ ^ ^
# | | patch
# | minor
# major (even = LTS line, odd = Current line)The major number tells you the release line. Even majors (20, 22, 24) are LTS; odd majors (21, 23, 25) are short-lived Current releases. The live card at the top of this page shows what is current right now.
Check the npm version
npm ships bundled with Node, so it is installed already. Check it the same way:
npm --version
# 10.9.0
npm -v
# 10.9.0Note there is no leading v on npm's output, unlike Node. That bites people writing string comparisons in scripts.
For a fuller picture, npm version (no dashes) prints npm's own version plus the Node version, V8, and the platform libraries, as a small object:
npm version
# {
# npm: '10.9.0',
# node: '22.11.0',
# v8: '12.4.254.21-node.21',
# ...
# }That single command is the fastest way to see Node and npm together without running two commands. One thing to know: if you run npm version inside a directory that has a package.json, npm prepends that project's own version as the first key (for example myproject: '1.0.0'), then lists npm, node, and the rest. Outside a project the object starts at npm. Either way, the node and npm keys are what you are after.
If you want the full runtime breakdown straight from Node without npm in the picture, node -p evaluates an expression and prints the result, so you can dump every bundled library version in one line:
node -p "process.versions"
# {
# node: '22.11.0',
# v8: '12.4.254.21-node.21',
# uv: '1.49.2',
# ...
# }That is the same object you would log from inside a script (see reading the version inside a script), without writing a file or dropping into the REPL.
Which Node is actually running (PATH)
This is the part that causes real confusion. node -v reports whatever node binary your shell finds first on PATH. If you have a system install, a version-manager install, and maybe a Homebrew install all present, they fight, and the one that wins is not always the one you think.
Find the actual binary:
# Linux / macOS
which node
# /Users/you/.nvm/versions/node/v22.11.0/bin/node
# Windows (PowerShell)
where.exe node
# C:\Program Files\nodejs\node.exeThe path tells you the install type at a glance:
| Path contains | Install type |
|---|---|
.nvm/versions/node/ | nvm |
.fnm/ or fnm_multishells | fnm |
.volta/ | Volta |
/usr/local/bin/node or /usr/bin/node | system / package manager |
Cellar/node (macOS) | Homebrew |
Program Files\nodejs (Windows) | the official .msi installer |
On Linux and macOS, command -v node does the same job and is the more portable form in scripts. If you suspect more than one install, list them all:
# Linux / macOS, show every node on PATH
type -a node
# node is /Users/you/.nvm/versions/node/v22.11.0/bin/node
# node is /usr/local/bin/nodeThe first line wins. When node -v and a version manager disagree (for example nvm current says one thing, node -v another), it is almost always because the version manager's shell hook has not loaded in that shell, so PATH still points at the system binary. Open a fresh terminal, or re-source your shell rc file.
Read the version inside a script
Inside a running Node process, the version is on process.version (a string, with the v) and process.versions (an object with Node, V8, and every bundled library):
console.log(process.version);
// v22.11.0
console.log(process.versions.node);
// 22.11.0 (no leading v)
console.log(process.versions);
// { node: '22.11.0', v8: '12.4.254.21-node.21', uv: '1.49.2', ... }process.versions.node is the clean numeric string, easier to parse than process.version because it has no v to strip. To gate behaviour on a major version:
const major = parseInt(process.versions.node.split(".")[0], 10);
if (major < 20) {
console.error("This tool needs Node 20 or newer.");
process.exit(1);
}From a shell script, capture the CLI output instead:
NODE_MAJOR=$(node -v | sed 's/v//' | cut -d. -f1)
echo "Running Node major: $NODE_MAJOR"The sed 's/v//' strips the leading v that node -v prints; process.versions.node would not need it, which is why the in-process value is nicer when you have the choice.
Check the version a project expects
Knowing your installed version is half the question. The other half is what a given project wants. Look at package.json:
# the engines field declares the supported range (advisory)
cat package.json | grep -A2 '"engines"'
# "engines": {
# "node": ">=20.0.0"
# }A project may also pin an exact version in a .nvmrc or .node-version file:
cat .nvmrc
# 22If your installed node -v falls outside the project's engines.node range, npm install warns by default (and errors if the project sets engine-strict=true in .npmrc). Matching the two is what pinning a Node version per project is for.
Version managers: nvm, fnm, Volta
If you use a version manager, it has its own command to show what it considers active, which is worth cross-checking against node -v:
| Manager | Show active version | List installed versions |
|---|---|---|
| nvm | nvm current | nvm ls |
| fnm | fnm current | fnm list |
| Volta | volta list node | volta list all |
| n | n --version shows n itself; node -v for active | n ls |
| asdf | asdf current nodejs | asdf list nodejs |
If node -v and nvm current disagree, the manager's shell integration has not loaded in the current shell (the most common cause), or another node earlier on PATH is shadowing it. The which node / type -a node checks above will show you which. To switch and confirm in one go with nvm:
nvm use --lts
node -v # confirm it actually changedFor the full comparison of these managers and when to reach for each, see the version manager comparison.
Checking on Windows
The commands are the same in PowerShell and Command Prompt:
node --version
# v22.11.0
npm --version
# 10.9.0The difference is locating the binary. which does not exist in stock Windows shells; use where.exe node (or Get-Command node in PowerShell):
where.exe node
# C:\Program Files\nodejs\node.exe
Get-Command node | Select-Object Source
# C:\Program Files\nodejs\node.exeIf node is not recognised right after an install, the PATH change has not reached your open terminal. Close it and open a fresh one. If it is still missing, the installer's "Add to PATH" step did not complete, and reinstalling from the official installer fixes it.
See also
- How to install Node.js: the install paths (official installer, version managers, package managers) behind every binary this page helps you locate.
- Updating Node.js with nvm, fnm, Volta, or a direct install: the next step once
node -vtells you the version is older than you want. - Per-project version pinning:
.nvmrc,.node-version, andengines.node, so the version you check matches what the project expects.
FAQ
Sources
Authoritative references this article was fact-checked against.
- process.version and process.versions (Node.js API docs)nodejs.org
- npm version command (npm CLI docs)docs.npmjs.com
- nvm (Node Version Manager) READMEgithub.com
- fnm (Fast Node Manager) READMEgithub.com





