Node.js 分段错误:11
运行 Node.js 时遇到问题。我在 OSX Lion 上,遵循节点的安装说明。根据node --version,我使用的是v0.5.9-pre,但是当我尝试运行
node app.js
时,我得到“Segmentation failure:11”。
app.js 文件只是主站点中的 hello world 示例:
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/');
没什么特别的。尝试在网络上查找,但似乎没有任何答案。有什么想法吗?
having a problem getting node.js to run. I'm on OSX Lion, followed the installation instructions for node. I'm on v0.5.9-pre, according to node --version, but when I try to run
node app.js
I get "Segmentation fault: 11".
The app.js file is just the hello world example from the main site:
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/');
Nothing special. Tried looking over the web, but nothing seems to answer this. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我从 Node 0.4 升级到 0.6 后遇到了这个问题。我只需要从我的应用程序中删除 node_modules 目录,然后再次使用“npm install”重新安装依赖项。
I had this after upgrading from Node 0.4 to 0.6. I just needed to delete the node_modules directory from my app and re-install the dependencies with 'npm install' again.
没关系。刚刚使用 homebrew 安装了 node.js/npm,现在一切正常。不管怎样,谢谢。
Never mind. Just used homebrew to install node.js/npm and all working fine now. Thanks anyway.