Drupal - How do I prevent Drupal raising a segmentation fault when using a Node.js theming workflow?

Here is the solution you're looking for. Much more elegant and less work:

"scripts": {
  "postinstall": "find node_modules/ -name '*.info' -type f -delete"
}

Just a slight alteration on @iamcarico's answer above.

note: you may need a .npmrc with just the following content:

unsafe-perm = true

So, I have a slightly more elegant solution, that will just remove the .info files after npm install. None are needed, so this Should be safe.

Add the following to the end of your package.json:

"scripts": {
  "postinstall": "find node_modules/ -name \"*.info\" -type f -delete"
}

This works for me:

(With many thanks to @jorgegc for identifying the cause in this thread at d.o. I thought the topic deserved a more general title here.)

  1. Move gulpfile.js and package.json to the new "hidden" directory .npm
  2. cd .npm and npm install (after having deleted theme root level node_modules directory of course)
  3. edit gulpfile.js base directory for source and destination file paths.e.g. In the snippet bellow "../" were prepended to paths
  4. in turn, invoke gulp command from within the .npm directory

Example directory structure for ihit theme

. ├── .editorconfig ├── .git │   ├── HEAD │   ├── ... ├── .gitignore ├── .jshintrc ├── .npm │   ├── gulpfile.js │   ├── node_modules │   └── package.json ├── assets │   ├── images │   ├── js │   └── sass ├── css │   ├── ihit.hacks.css │   └── ihit.styles.css ├── ihit.info ├── ihit.sublime-project ├── ihit.sublime-workspace ├── images │   ├── logo.png │   ├── search-icon.png │   └── sprite.png ├── js │   └── ihit.behaviors.js ├── php │   ├── ihit_breadcrumb.inc │   ├── ihit_form_search_form_alter.inc │   ├── ihit_menu_link.inc │   ├── ihit_menu_tree.inc │   ├── ihit_preprocess_html.inc │   ├── ihit_preprocess_region.inc │   └── ihit_process_page.inc ├── research │   └── Refills ├── screenshot.png ├── template.php └── templates ├── html.tpl.php ├── node--image_gallery.tpl.php ├── node.tpl.php └── page.tpl.php

Head of gulpfile.js

// project-specific var project = { path: { sass: { source: '../assets/sass/**/*.scss', css_dest: '../css' }, // sass . . .

Tags:

Drush

Theming