开发者

ares_library_init error in Node.js

开发者 https://www.devze.com 2023-03-25 03:21 出处:网络
I have a problem running a simple Hello World on Node.js. I\'m using CentOS and installed it via yum. When I run the file with Node.js, this error pops up:

I have a problem running a simple Hello World on Node.js. I'm using CentOS and installed it via yum. When I run the file with Node.js, this error pops up:

node: symbol lookup error: node: undefined symbol: ares_library_init

I tried searching google to no avail. I only found th开发者_如何学JAVAat this belongs to the c-ares library. Any idea of how I can solve this?

The file contains this:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');


Solved it. You can't use yum.

yum remove nodejs
git clone http://github.com/joyent/node.git
cd node
git checkout v0.4.10
./configure
make
make install
0

精彩评论

暂无评论...
验证码 换一张
取 消