What is the correct command to check Node version and how can I verify it properly?

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

:point_right: 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

:point_right: 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

:point_right: This shows all installed Node.js versions and the one currently in use.