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

后端 未结 13 936
不思量自难忘°
不思量自难忘° 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:49

    Try nodejs instead of just node

    $ nodejs -v
    v0.10.25
    
    0 讨论(0)
  • 2020-12-07 08:52

    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.

    0 讨论(0)
  • 2020-12-07 08:53

    open node.js command prompt
    run this command

    node -v

    0 讨论(0)
  • 2020-12-07 08:54

    Node:

    node --version or node -v

    npm:

    npm --version or npm -v

    V8 engine version:

    node -p process.versions.v8
    
    0 讨论(0)
  • 2020-12-07 08:57

    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.

    0 讨论(0)
  • 2020-12-07 08:58

    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',
      .......
    
    0 讨论(0)
提交回复
热议问题