Gulp: Segmentation Fault 11 after Node 4.0 update
Asked Answered
F

6

17

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.

Thoughts?

Forgery answered 9/9, 2015 at 2:34 Comment(1)
Remove your node_modules directory, then run npm cache clean && npm install. Lastly npm uninstall -g gulp && npm install -g gulp.Froghopper
D
19

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.

Dangerfield answered 9/9, 2015 at 3:34 Comment(0)
F
11

The suggestion to delete node_modules and then run npm install is a good one. It will work. Slightly more efficient, though, might be to just run npm rebuild without deleting node_modules or running npm install. It will re-compile native modules for the new version of Node/V8 you have installed without having to download all the files again.

But if all else fails:

  • Remove your node_modules directory
  • npm cache clean && npm install
  • npm uninstall -g gulp && npm install -g gulp
Froghopper answered 9/9, 2015 at 20:33 Comment(5)
The npm rebuild step didn't solve the problem for me. Your other suggestion is a duplicate of previous suggestions.Forgery
Upvoted you @Froghopper because, although it partially duplicated others, it was a very thorough answer with possible alternatives. +1 from me.Rhigolene
Aw, thanks. At the risk of sounding peevish, the whole having a problem with duplicating another answer is a little misguided anyway. The answer I'm supposedly duplicating happens to actually duplicate the comment I had already made on the original post. And that's totally fine, whether it was intentional or not. The point is to craft the most useful answer, not to be fastest or most original.Froghopper
This worked for me! I was getting a segmentation fault [1] with laravel-elixir tried lots of other things but this worked. Thanks @FroghopperMargiemargin
I only had to run npm cache clean and it fixed my issueConglobate
T
3

I ran into this issue recently, and attempted the steps shown above:

$ npm cache clean && npm install

But was still getting the fault. Even after deleting all files and running

$ npm install

So, did some more rooting, and found that there was an issue whereby some of the node modules had a files ending in .info, which caused Drupal (in which I'm running this framework) to attempt reading the .info files as the theme.info file. Renaming these files (with a different ending) fixed the issue.

Although my problem Drupal-specific, I could imagine similar issues cropping up on other frameworks, as well.

Telugu answered 8/6, 2016 at 3:31 Comment(0)
T
1

My case the problem was that I had Node v5.9.0 installed. So I downgraded to v4.4.1-LTS and finally got it working again:

Using Homebrew:

$ brew tap homebrew/versions
$ brew install homebrew/versions/node4-lts

And then:

$ npm rebuild
Teresaterese answered 23/3, 2016 at 12:21 Comment(0)
V
1

I run across this bug today again. After about a hour of searching, reinstalling whole node.js, all plugins and gulp and cleaning cache of NPM, without solving it. I tried to go back few steppes in my SASS file.

And fixed it. But it was not by some mistake or variable in code but I made this statement to my file:

a
   transition: all 0.5s ease-in-out

   &:hover, &:focus
       transition: all 0.5s ease-in-out

Tried to make it again and again that bug occured. Really do not know why. When I use this statement nested in a class or another tag, it is working properly.

Valenciavalenciennes answered 1/5, 2017 at 21:4 Comment(2)
You might want to file an issue bug with node-sass on Gitub if that's your processor.Forgery
Fixed the issue by upgrading the gulp-sass dependency to the newest version.Wendelin
R
0

Please, delete your node_modules from project and do npm install

Rhapsody answered 21/9, 2017 at 7:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.