Node.js 节点JS安装-引用错误:未定义节点问题

Node.js 节点JS安装-引用错误:未定义节点问题,node.js,Node.js,最近,我在Windows64位系统中安装了nodejs,当我尝试使用命令node-v检查时,它应该显示它的版本,但它显示错误 > node -v ReferenceError: node is not defined at repl:1:1 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at REPLServer.defaultEval (repl.js:240:29) at bound

最近,我在Windows64位系统中安装了nodejs,当我尝试使用命令node-v检查时,它应该显示它的版本,但它显示错误

> node -v
ReferenceError: node is not defined
    at repl:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at REPLServer.defaultEval (repl.js:240:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
    at REPLServer.onLine (repl.js:441:10)
    at emitOne (events.js:121:20)
    at REPLServer.emit (events.js:211:7)
    at REPLServer.Interface._onLine (readline.js:282:10)
    at REPLServer.Interface._line (readline.js:631:8)
>

我不明白原因。任何帮助都将不胜感激。

您可以通过两种方式检查版本,在bash shell或DOS shell中使用“node-v”,显示如下内容:

或者直接在节点外壳中使用process.version。由于在节点shell中键入“node-v”,因此会出现此错误


您在节点REPL内。键入进程。退出(1),然后键入节点-v

格式改进