运行Gulp任务时Node Sass中的Segmentation 11错误

时间:2019-07-17 03:37:04

标签: node.js gulp gulp-sass node-sass

在过去的几个小时中,我一直在与这个问题作斗争,但不幸的是,我在网上找到的所有修复程序都不适用于我。

运行诸如gulp deploy(我正在为Netsuite开发)之类的gulp任务时,该任务将一直运行,直到编译SASS,然后出现此错误:

/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

我尝试删除并重新安装节点模块,还尝试了不同版本的节点,但是不幸的是,我必须在4.0.0-LTS之间使用,就像我所使用的Suitecommerce Advanced版本所定义的一样。

我当前正在使用节点4.9.1和npm 2.15.11。

观看任务运行正常,只有在为生产编译SCSS时才会发生此错误。

在这里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"
  }
}

任何帮助将不胜感激?

谢谢!

1 个答案:

答案 0 :(得分:0)

我建议为amd-optimizer更新package.json的条目。 https://www.npmjs.com/package/gulp-amd-optimizer上显示的最新版本是0.6.0。

根据https://docs.npmjs.com/cli/update,我建议使用npm update命令:

npm update amd-optimizer

您可能需要指定软件包版本,在这种情况下,它将为amd-optimizer@0.6.0

请注意,npm update还会根据文档页面更新package.json文件。

运行此命令时,您可能需要位于node_modules目录中。

希望这会有所帮助,