Node.js version on the command line? (not the REPL)
I want to get the version of Node.js on the command line. I'm expecting to run a command like:
but that doesn't work. Does anybody know what the command line would be? (i.e. not the REPL)
The command line for that is:
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.
Read more... Read less...
If you're referring to the shell command line, either of the following will work:
node -v node --version
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.
nodejs instead of just
$ nodejs -v v0.10.25
node --version or
npm --version or
V8 engine version:
node -p process.versions.v8
Repl Command to find the Nodejs Version
$node >process.version `v8.x`