Search code examples
node.jsgulpgulp-sassnode-sass

Segmentation 11 Error in Node Sass when running a Gulp Task


I've been battling with this issue for the past few hours now and all of the fixes I've found online have unfortunately not worked for me.

When running a gulp task, such as gulp deploy (I'm developing for Netsuite) the task will run until compiling SASS and then I get this error:

/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/lib/parse.js:14
      return a.value;
              ^

TypeError: Cannot read property 'value' of null
    at /Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/lib/parse.js:14:15
    at Array.map (native)
    at valuesFromArrayExpression (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/lib/parse.js:13:26)
    at walk.ancestor.CallExpression (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/lib/parse.js:77:22)
    at c (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:47:18)
    at Object.skipThrough (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:163:39)
    at c (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:46:17)
    at Object.base.ExpressionStatement (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:176:5)
    at c (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:46:17)
    at Object.skipThrough (/Users/chrismartyr/Documents/GitHub/ChannelTen/node_modules/amd-optimize/node_modules/acorn/util/walk.js:163:39)
Segmentation fault: 11

I've tried removing and re installing the node modules, I've also tried different versions of node, unfortunately I have to use between 4.0.0 - LTS as if defined by the version of Suitecommerce Advanced I'm using.

I'm currently using node 4.9.1 and npm 2.15.11.

Watch tasks run fine, it's only when it's compiling the SCSS for production that this error occurs..

Heres the package.json:

{
  "name": "suitecommerce-builder",
  "version": "0.0.1",
  "description": "Sets of tasks to build a Reference Implementation",
  "main": "gulpfile.js",
  "private": true,
  "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
      "amd-optimize": "0.3.1",
      "archiver": "0.13.0",
      "async": "0.9.0",
      "cli-spinner": "0.1.5",
      "del": "0.1.1",
      "escodegen": "1.6.1",
      "esprima": "1.2.5",
      "estraverse": "1.9.3",
      "express": "4.13.3",
      "glob": "4.0.4",
      "gulp": "3.8.7",
      "gulp-add": "0.0.2",
      "gulp-bless": "3.0.1",
      "gulp-changed": "1.0.0",
      "gulp-concat": "2.3.3",
      "gulp-cssfmt": "^1.0.0",
      "gulp-handlebars": "3.0.1",
      "gulp-if": "1.2.5",
      "gulp-insert": "0.4.0",
      "gulp-jshint": "1.9.0",
      "gulp-jst": "0.1.1",
      "gulp-less": "1.3.6",
      "gulp-livereload": "2.1.1",
      "gulp-minify-css": "0.3.13",
      "gulp-sass": "2.1.0",
      "gulp-sourcemaps": "1.2.8",
      "gulp-svg2ttf": "1.0.3",
      "gulp-ttf2eot": "1.0.1",
      "gulp-ttf2woff": "1.0.1",
      "gulp-uglify": "0.3.1",
      "gulp-util": "3.0.1",
      "handlebars": "2.0.0",
      "inquirer": "0.5.1",
      "is-my-json-valid": "2.13.1",
      "jshint-stylish": "1.0.0",
      "jsonlint": "1.6.2",
      "jsonpath-plus": "0.15.0",
      "lazypipe": "0.2.2",
      "lodash": "2.4.1",
      "map-stream": "0.1.0",
      "mime": "1.2.11",
      "moment": "2.8.3",
      "node-sass": "3.4.1",
      "ns-uploader": "file:./ns_npm_repository/ns-uploader",
      "progress": "1.1.7",
      "q": "1.0.1",
      "request": "2.39.0",
      "serve-index": "1.7.2",
      "shelljs": "^0.5.3",
      "short-jsdoc": "0.2.4",
      "sourcemap-to-ast": "0.0.2",
      "through": "2.3.6",
      "through2": "0.6.3",
      "underscore": "1.6.0",
      "vinyl": "0.4.6",
      "xml2js": "0.4.5",
      "yargs": "1.3.1",
      "credentials-inquirer": "file:./ns_npm_repository/credentials-inquirer",
      "suitetalk": "file:./ns_npm_repository/suitetalk4node",
      "preconditions": "file:./ns_npm_repository/preconditions",
      "xmlbuilder": "8.2.2"
  },
  "optionalDependencies": {
      "minijasminenode2": "1.0.0",
      "gulp-jasmine-phantom": "1.1.2",
      "fsevents": "0.3.7"
  }
}

Any help would be very much appreciated?

Thanks!


Solution

  • I would recommend updating package.json's entry for amd-optimizer. The latest version as shown on https://www.npmjs.com/package/gulp-amd-optimizer is 0.6.0.

    And as per https://docs.npmjs.com/cli/update, I'd recommend using the npm update command:

    npm update amd-optimizer
    

    You may need to specify the package version, in which case it will be amd-optimizer@0.6.0

    Note, npm update also updates the package.json file according to the docs page.

    You may need to be in the node_modules directory when running this command.

    Hope this helps,