Node.js version on the command line? (not the REPL)
Just type npm version
in your command line and it will display all the version details about node, npm, v8 engine etc.
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.
Try nodejs
instead of just node
$ nodejs -v
v0.10.25
If you're referring to the shell command line, either of the following will work:
node -v
node --version
Just typing node version
will cause node.js to attempt loading a module named version, which doesn't exist unless you like working with confusing module names.