Node.js version on the command line? (not the REPL)

hawkeye picture hawkeye · Feb 15, 2013 · Viewed 931.4k times · Source

I want to get the version of Node.js on the command line. I'm expecting to run a command like:

node -version

but that doesn't work. Does anybody know what the command line would be? (i.e. not the REPL)

Answer

JohnnyHK picture JohnnyHK · Feb 15, 2013

The command line for that is:

node -v

Or

node --version

Note:

If node -v doesn't work, but nodejs -v does, then something's not set up quite right on your system. See this other question for ways to fix it.