Advertisement
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
1
582
2/28/2020 11:57:11 AM

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
1047
5/23/2017 10:31:38 AM

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

Try nodejs instead of just node

$ nodejs -v
v0.10.25
2015/03/08

If you want to check in command prompt use node -v or node --version

v6.9.5

If u have node.exe then in node you can give.

>process
process {
  title: 'node',
  version: 'v6.9.5',
  .......
2017/02/03

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