How do I check Node version on the command line (not the REPL)?
I want to check Node version from the command line, but when I run:
node -version
it doesn’t work. What is the correct command to check Node version, and how can I verify it properly?
The correct syntax to check Node version is:
node -v
or
node --version
Either command will output something like:
v18.16.0
If node -version isn’t recognized, it might be a typo—the correct flag is -v or --version.
If the command isn’t working, Node.js might not be installed or isn’t in your system’s PATH. Run:
which node # macOS/Linux
where node # Windows
If no path is returned, install Node.js from nodejs.org.
You can also use nvm to check installed Node versions.
If you manage multiple versions using nvm (Node Version Manager), run:
nvm list
or
nvm current
This shows all installed Node.js versions and the one currently in use.