CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

发布时间 2023-03-23 13:50:30作者: googlegis

网上查应该是node导致的内存溢出,64位电脑默认1.4G,32位电脑默认0.7G

在package.json 中的 Scripts 中添加 node 的参数

  "scripts": {
    "serve": "node --max_old_space_size=10240 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
    "build": "vue-cli-service build --mode prod",
    "test": "vue-cli-service build --mode test",
    "lint": "vue-cli-service lint",
    "start": "npm run serve"
  },