Node.js version on the command line? (not the REPL)
Advertisement
Node.js version on the command line? (not the REPL)
Question
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)
2020/02/28
Accepted Answer
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.
2017/05/23
Read more… Read less…
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.
2013/02/15
Node:
node --version
or node -v
npm:
npm --version
or npm -v
V8 engine version:
node -p process.versions.v8
2016/05/07
Repl Command to find the Nodejs Version
$node
>process.version
`v8.x`
2017/10/03
Licensed under CC-BY-SA with attribution
Not affiliated with Stack Overflow
Email: [email protected]