nodejs编译报错

错误信息

报错

[jenkins@5a3e26f51f28 kanche-taurus]$ npm run build

> kanche-taurus@ build /home/jenkins/workspace/kanche-taurus
> atool-build

📦  2659/2659 build modules

#
# Fatal error in , line 0
# API fatal error handler returned after process out of memory
#
Illegal instruction (core dumped)

package.json

 "scripts": {
    "build": "atool-build",
    "lint": "eslint --ext .js,.jsx src/",
    "start": "dora --plugins \"proxy,webpack,webpack-hmr,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/entries/index.html\"",
    "mytest": "atool-test-mocha --coverage",
    "autofix": "node_modules/.bin/eslint .js,.jsx src/ --fix"
  },

运行方式

npm run build

解决方案

  "scripts": {
    "build": "node --max-old-space-size=2000 ./node_modules/.bin/atool-build",
    "lint": "eslint --ext .js,.jsx src/",
    "start": "dora --plugins \"proxy,webpack,webpack-hmr,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/entries/index.html\"",
    "mytest": "atool-test-mocha --coverage",
    "autofix": "node_modules/.bin/eslint .js,.jsx src/ --fix"
  },

参考