更新 - LINUX FEDORA 15
以下示例:
http://simonwillison.net/2009/Nov/23/node/
我的代码:
var util = require('util'),
http = require('http');
http.createServer(function(req, res) {
res.sendHeader(200, {'Content-Type': 'text/html' });
res.sendBody('<h1>Hello World</h1>');
res.finish();
}).listen(8080);
util.puts('Server running at http://127.0.0.1:8080');
产生以下错误:
[abu@Beelzebub node_projects]$ nodejs helloworld.js
Server running at http://127.0.0.1:8080
nodejs: symbol lookup error: nodejs: undefined symbol: _ZN2v82V816IdleNotificationEv
答案 0 :(得分:0)
要执行node.js应用程序,请使用node而不是nodejs调用它。
node helloworld.js
特定错误似乎与Node 0.6.15中的V8构建不匹配问题类似。您是否尝试过使用较新的(或回滚到旧版本)Node? p>
答案 1 :(得分:0)
在Fedora Linux上执行node.js安装下载并安装独立的rpm(http://nodejs.tchol.org/stable/f16/SRPMS/repoview/nodejs.html)并执行安装如下:
使用包管理器删除任何现有节点和nodejs应用程序
从独立rpm安装node.js
rpm -ivh 。/配置 使 make install
尝试使用程序包管理器可能会导致依赖性问题,如以下站点所述:
答案 2 :(得分:0)
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.listen(8000);
console.log("Server running at http://127.0.0.1:8000/");
你的教程很旧:)切换到这个 - &gt;