Node.js 分段错误:11

发布于 2024-12-08 15:28:53 字数 496 浏览 0 评论 0原文

运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

菊凝晚露 2024-12-15 15:28:53

我从 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.

秉烛思 2024-12-15 15:28:53

没关系。刚刚使用 homebrew 安装了 node.js/npm,现在一切正常。不管怎样,谢谢。

Never mind. Just used homebrew to install node.js/npm and all working fine now. Thanks anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文