I just reinstalled NodeJS. Before reinstalling, when I ran node -v , I got a version number that said something like "0.2.x" ... It was a weird number. And since I read this morning, Node was just upgraded to version 4.xx. I thought I should update it. Also, I had other problems, so I thought that might be the reason for this.
When I start the following server.js, I get the following console listing.
server.js ...
var express = require('express'); var mongoose = require('mongoose'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var _ = require('lodash'); // Create the application. var app = express(); // Add Middleware necessary for REST API's app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); app.use(methodOverride('X-HTTP-Method-Override')); // CORS Support app.use(function(req, res, next) { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); res.header('Access-Control-Allow-Headers', 'Content-Type'); next(); }); // Connect to MongoDB mongoose.connect('mongo connection string......'); mongoose.connection.once('open', function() { // Load the models. app.models = require('./models/index'); // Load the routes. var routes = require('./routes'); _.each(routes, function(controller, route) { app.use(route, controller(app, route)); }); console.log('Listening on port 3000...'); app.listen(3000); });
The console displays the following data after starting node --debug server.js
Debugger listening on port 5858 Segmentation fault: 11
Edit: I have another project based on MEANJS. When I run Gruntfile.js , I get a Segmentation fault: 11 from the console.
Edit # 2: I just dropped to Node v0.12.7 and everything looks fine ...
source share