Drush throwing ‘Segmentation fault: 11’ error thanks to node_modules dir in inconvenient location

So I recently started seeing a ‘Segmentation fault: 11’ error whenever I ran a drush command for my various Drupal sites at work. So some research turned up this very helpful post: http://dannyenglander.com/blog/drupal-drush-segmentation-fault-11-error-avoiding-rabbit-hole. The problem, as it turned out, was related to the fact that we use node/npm to compile our SASS. When installing the node packages, there is a dir created called node_modules, and this dir contains a .info file that Drupal thought was a Drupal .info file, which led to that lovely segmentation error.

So – our SASS (which is a framework shared across many sites) primarily lives in a dir in /libraries, which is added to the system via a simple custom module. Then, in the theme for each site, this SASS framework was being symlinked in, so that each site would have its own vars file, index file, along with any custom scss files needed that apply just for that site. The symlink was causing the issue. So, I removed the symlink, so now the files accessing the SASS framework have much grosser looking paths to get to the files they need, but the segmentation error is gone at least.

Drupal does not check the /libraries dir for .info files, which makes it a convenient place to store anything node related if that’s necessary for the site.

Leave a Reply