我是node.js的新手。我遵循Here的下载和安装说明。运行node.js时出现问题
现在的问题是,当我尝试这在我的终端
我获得以下消息
No script was specified.
Usage: node [options] script.js [arguments]
Options:
-v, --version print node's version
--debug[=port] enable remote debugging via given TCP port
without stopping the execution
--debug-brk[=port] as above, but break in script.js and
wait for remote debugger to connect
--v8-options print v8 command line options
--vars print various compiled-in variables
Enviromental variables:
NODE_PATH ':'-separated list of directories
prefixed to the module search path,
require.paths.
NODE_DEBUG Print additional debugging output.
Documentation can be found at http://nodejs.org/api.html or with 'man node'
之后,我试过了这个例子:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
它说:引发ReferenceError :控制台未定义。
我GOOGLE了这一点,并发现我还没有安装正确的NodeJS,所以我又安装了它,但没有成功:(
请帮助!
如果你输入'node --version',你会得到什么? – yojimbo87 2011-04-16 08:06:11