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

后端 未结 13 934
不思量自难忘°
不思量自难忘° 2020-12-07 08:01

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

13条回答
  •  無奈伤痛
    2020-12-07 08:37

    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.

提交回复
热议问题