节点JS安装 – ReferenceError:节点没有定义的问题

最近,我已经在我的窗口64位系统中安装了nodejs,当我尝试使用命令节点-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中。 你得到这个错误,因为你在节点shell中键入“node -v”

在这里输入图像说明

你在Node REPL里面。 键入process.exit(1) ,然后键入node -v