FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of...

在nuxt部署的时候,出现这个error,就是内存溢出了,需要加个 空间

<--- Last few GCs --->

[6088:00000000005BA500]    41296 ms: Scavenge 1395.0 (1425.2) -> 1394.2 (1425.7) MB, 3.3 / 0.0 ms  (average mu = 0.085, current mu = 0.037) allocation failure

[6088:00000000005BA500]    41314 ms: Scavenge 1395.4 (1425.7) -> 1394.8 (1426.7) MB, 3.9 / 0.0 ms  (average mu = 0.085, current mu = 0.037) allocation failure

[6088:00000000005BA500]    41332 ms: Scavenge 1396.1 (1426.7) -> 1395.5 (1431.7) MB, 4.2 / 0.0 ms  (average mu = 0.085, current mu = 0.037) allocation failure

<--- JS stacktrace --->


解决方案

"scripts": {

    "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server --exec babel-node",

    "build": "nuxt build",

    "start": "nuxt --max_old_space_size=4096 start",

    "startDev": "cross-env NODE_ENV=production node server/index.js --exec babel-node",

    "generate": "nuxt generate",

    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",

    "precommit": "npm run lint"

  },

你可能感兴趣的:(FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of...)