1

I was coding as usual, doing simple scss (nothing fancy, adding animate to a div) when I started getting

segmentation fault (core dumped) gulp

I deleted my node_modules, did an npm-install, nothing changes.

I've seen many people successfully do this, but I can't.

For some reason, it's looking for a libsass bending here:

node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node

But my folder is structured differently:

node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-47/binding.node

I am using gulp on a Kubuntu 15.04 update to 15.10 and everything was smooth.

Here's my gulp file:

var gulp = require('gulp'),
    sass = require('gulp-sass'),
    minifyCss = require('gulp-minify-css'),
    gulpConcat = require('gulp-concat'),
    rename = require('gulp-rename'),
    sourcemaps = require('gulp-sourcemaps'),
    livereload = require('gulp-livereload'),
    uglify = require('gulp-uglify');

gulp.task('sass', function () {
  gulp.src('./scss/**/*.scss')
    .pipe(sourcemaps.init())
    .pipe(sass().on('error', sass.logError))
    // .pipe(minifyCss())
    .pipe(sourcemaps.write('/'))
    .pipe(gulp.dest(''))
    .pipe(livereload());
});

gulp.task('compress', function() {
  return gulp.src(['javascripts/application.js'])
    .pipe(sourcemaps.init())
    .pipe(sourcemaps.write())
    .pipe(uglify())
    .pipe(gulpConcat('application.min.js'))
    .pipe(gulp.dest(''))
    .pipe(livereload());
});

gulp.task('sass:watch', function () {
    gulp.watch('scss/**/*.scss', ['sass']);
    gulp.watch('javascripts/**/*.js', ['compress']);
});

gulp.task('default', ['sass:watch', 'compress'], function() {
    livereload.listen();
});

And here's the full error:

/home/XX/workspace/XX/assets/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:158
    throw new Error([
          ^
Error: The `libsass` binding was not found in /home/XX/workspace/XX/assets/node_modules/gulp-sass/node_modules/node-sass/vendor/linux-x64-14/binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
    at Object.sass.getBinaryPath (/home/XX/workspace/XX/assets/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:158:11)
    at Object.<anonymous> (/home/XX/workspace/XX/assets/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:16:36)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/XX/workspace/XX/assets/node_modules/gulp-sass/index.js:176:21)
    at Module._compile (module.js:460:26)
  • track the `sourcemaps` portion, because i dont know anything about that for one, just a hunch, but normally i dont see that error (have before though, cant remember exactly what caused it at the moment) – blamb Nov 09 '15 at 03:30

1 Answers1

0

It seems that the gulp-sass (which uses the node-sass plugin ) version you have is not compatible with your nodejs version, try to update them both to the newest versions and it should work, if it does not work you should check if an alternate version of nodejs exist on your computer which this project uses as default instead of the one you updated. Either way - your nodejs version is not compatible with this plugin.

Ran Sasportas
  • 2,256
  • 1
  • 14
  • 21