简体   繁体   English

node.js分段错误:11

[英]node.js segmentation fault:11

having a problem getting node.js to run. 在运行node.js时遇到问题。 I'm on OSX Lion, followed the installation instructions for node. 我在OSX Lion上,遵循节点的安装说明。 I'm on v0.5.9-pre, according to node --version, but when I try to run 根据节点--version,我在v0.5.9-pre,但是当我尝试运行时

node app.js 节点app.js

I get "Segmentation fault: 11". 我得到“Segmentation fault:11”。

The app.js file is just the hello world example from the main site: 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/');

Nothing special. 没什么特别的。 Tried looking over the web, but nothing seems to answer this. 试着看着网络,但似乎没有回答这个问题。 Any ideas? 有任何想法吗?

I had this after upgrading from Node 0.4 to 0.6. 从Node 0.4升级到0.6后,我有了这个。 I just needed to delete the node_modules directory from my app and re-install the dependencies with 'npm install' again. 我只需要从我的应用程序中删除node_modules目录,然后再次使用'npm install'重新安装依赖项。

Never mind. 没关系。 Just used homebrew to install node.js/npm and all working fine now. 刚用homebrew安装node.js / npm,现在一切正常。 Thanks anyway. 不管怎么说,还是要谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM