我在 Node.js 上运行一个简单的 Hello World 时遇到问题。我正在使用 CentOS 并通过 yum 安装它。当我使用 Node.js 运行文件时,会弹出此错误:
node: symbol lookup error: node: undefined symbol: ares_library_init
我尝试搜索谷歌无济于事。我只发现这是属于c-ares库的。知道如何解决这个问题吗?
该文件包含以下内容:
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('服务器运行在 http://127.0.0.1:1337/');