Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js segmentation fault:11

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?

like image 294
David Archer Avatar asked Oct 07 '11 21:10

David Archer


People also ask

What causes segmentation fault 11?

When Segmentation fault 11 occurs, it means that a program has attempted to access a memory location that it's not allowed to access. The error can also occur if the application tries to access memory in a method that isn't allowed.

What is node segmentation fault?

A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system). -

What is zsh segmentation fault?

A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core . Segfaults are caused by a program trying to read or write an illegal memory location.

What NPM rebuild does?

Description. The npm-rebuild command will run npm build command on the matched folders. This command is particularly useful when you install a new version of node, and you have to recompile all your C++ addons with the new binary. Npm-repo. This command opens a package repository page in the browser.


2 Answers

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.

like image 156
poshaughnessy Avatar answered Sep 23 '22 08:09

poshaughnessy


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

like image 20
David Archer Avatar answered Sep 24 '22 08:09

David Archer