in code veritas in code veritas - 1 year ago 167
Node.js Question

Gulp: Segmentation Fault 11 after Node 4.0 update

I just updated to Node 4.

When I run Gulp, I see:

Segmentation fault: 11

My includes:

var gulp = require('gulp');

var jscs = require('gulp-jscs');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var responsive = require('gulp-responsive');
var imagemin = require('gulp-imagemin');
var jpegtran = require('imagemin-jpegtran');
var rollup = require('gulp-rollup');
var webp = require('gulp-webp');
var spritesmith = require('gulp.spritesmith');

I am unable to get a debug task to run. Verbose doesn't spit out anything additional.


Answer Source

I also update to Node 4.0 and get a segmentation fault on my node server too. I just delete my node_modules directory and rerun npm install, and it is fine.

So I suspect it is because the new version of npm has trouble to load some modules installed by old npm --- but just for some modules, it is OK to directly run npm start after updating on my other servers. I haven't went deep into this.

As a quick fix I think you can try this on your own dependencies.