首次使用node.js-"ReferenceError:未定义节点" [英] First time using node.js - "ReferenceError: node is not defined"

查看:178
本文介绍了首次使用node.js-"ReferenceError:未定义节点"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了node.js. 我尝试编写应该检查版本的节点-v,但它不起作用.这是输出:

I just installed node.js. I tried writing node -v that should check the version - and it's not working. this is the output:

 > node -v ReferenceError: node is not defined 

at repl:1:2 at REPLServer.self.eval (repl.js:110:21) 

at Interface.<anonymous> (repl.js:239:12) 

at Interface.emit (events.js:95:17) 

at Interface._onLine (readline.js:202:10) 

at Interface._line (readline.js:531:8) 

at Interface._ttyWrite (readline.js:760:14) 

at ReadStream.onkeypress (readline.js:99:10) 

at ReadStream.emit (events.js:98:17) 

at emitKey (readline.js:1095:12) >

我使用git-命令打开它:node

I opened it using git - command: node

我尝试使用"Git"运行它,以为可能是问题所在,并且我得到了完全相同的输出.

I tried running it using "Git", thought maybe that's the issue and I get the exact same output.

如果相关,我正在使用Windows 8-到目前为止,请遵循本教程:

I am using windows 8 if it's relevant - followed this tutorial till now:

https://www.youtube.com/watch?v=tlntE8fe6u4

http://youtu.be/FqMIyTH9wSg

我如何使其工作?

推荐答案

您似乎已输入节点REPL ,然后键入node -v

It looks like you have entered the node REPL and then typed node -v

好消息是这意味着节点正在运行!

The good news is that this means node is working!

要从此处检查版本,可以键入process.version以获取节点版本.或者,键入process.exit()退出节点REPL并返回bash(或等效终端).

To check the version from here you can type process.version to get the node version. Alternatively type process.exit() to exit the node REPL and get back to bash (or equivalent terminal).

从这里node -v应该只输出节点版本.

From here node -v should just output the node version.

这篇关于首次使用node.js-"ReferenceError:未定义节点"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆