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

node.jsCommand Line

node.js Problem Overview


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)

node.js Solutions


Solution 1 - node.js

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.

Solution 2 - node.js

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.

Solution 3 - node.js

Try nodejs instead of just node

$ nodejs -v
v0.10.25

Solution 4 - node.js

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',
  .......

Solution 5 - node.js

Just type npm version in your command line and it will display all the version details about node, npm, v8 engine etc.

enter image description here

Solution 6 - node.js

>>Repl Command to find the Nodejs Version

$node
>process.version
`v8.x`

Solution 7 - node.js

Node:

node --version or node -v

npm:

npm --version or npm -v

V8 engine version:

node -p process.versions.v8

Solution 8 - node.js

find the installed node version.

$ node --version

or

 $ node -v

And if you want more information about installed node(i.e. node version,v8 version,platform,env variables info etc.)

then just do this.

$ node
> process
  process {
  title: 'node',
  version: 'v6.6.0',
  moduleLoadList: 
   [ 'Binding contextify',
     'Binding natives',
     'NativeModule events',
     'NativeModule util',
     'Binding uv',
     'NativeModule buffer',
     'Binding buffer',
     'Binding util',
     ...
    

where The process object is a global that provides information about, and control over, the current Node.js process.

Solution 9 - node.js

Write this command to check the version of node.js

node --version

Solution 10 - node.js

By default node package is nodejs, so use

$ nodejs -v

or

$ nodejs --version 

You can make a link using

$ sudo ln -s /usr/bin/nodejs /usr/bin/node

then u can use

$ node --version

or

$ node -v

Solution 11 - node.js

One cool tip if you are using the Atom editor.

$ apm -v
apm  1.12.5
npm  3.10.5
node 4.4.5
python 2.7.12
git 2.7.4

It will return you not only the node version but also few other things.

Solution 12 - node.js

For Node Js version -

node -v

Or

node --version

For NPM version -

npm -v

or

npm -version

in windows os we can't use nodejs -v, it doesn't work.

Solution 13 - node.js

On an Arm7 (armhf) device running Debian Stretch, I had to issue either of the following:

$ nodejs -v
$ nodejs -h

The following did not work:

$ node -v
$ node -h
$ apm -v

Hope this helps someone else.

Solution 14 - node.js

  1. Open Command line prompt
  2. node -v

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionhawkeyeView Question on Stackoverflow
Solution 1 - node.jsJohnnyHKView Answer on Stackoverflow
Solution 2 - node.jsAustin MullinsView Answer on Stackoverflow
Solution 3 - node.jsSriluView Answer on Stackoverflow
Solution 4 - node.jsuser6097020View Answer on Stackoverflow
Solution 5 - node.jsHimanshuView Answer on Stackoverflow
Solution 6 - node.jsmuthukumar selvarajView Answer on Stackoverflow
Solution 7 - node.jsimrekView Answer on Stackoverflow
Solution 8 - node.jsSiyaram MalavView Answer on Stackoverflow
Solution 9 - node.jskhawarView Answer on Stackoverflow
Solution 10 - node.jsJatin MalwalView Answer on Stackoverflow
Solution 11 - node.jsprostiView Answer on Stackoverflow
Solution 12 - node.jsManoj DharkarView Answer on Stackoverflow
Solution 13 - node.jsFiddy BuxView Answer on Stackoverflow
Solution 14 - node.jsMuralidharan CView Answer on Stackoverflow