[Front-end] FATAL ERROR error during compilation: Reached heap limit Allocation failed - JavaScript heap out of memory

references

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Vue-cli3 nodejs memory overflow problem when executing serve and build commands and solving the
problem of startup error due to insufficient memory provided by vue project

error message

The error message when compiling is as follows

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Approach

  1. Install cross-env increase-memory-limit
npm install -D cross-env increase-memory-limit
  1. Configure in the script in package.json
"scripts": {
    
    
  "limit": "cross-env LIMIT=8192 increase-memory-limit"
},

Guess you like

Origin blog.csdn.net/macaiyun0629/article/details/132639953