Error Messages: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory
Solution:
Step 1.
Install the npm packages increase-memory-limit and cross-env
npm install increase-memory-limit cross-env -g
Step 2.
Add to package.json.
“fix-memory-limit”: “cross-env LIMIT=4096 increase-memory-limit”
Step 1.
Install the npm packages increase-memory-limit and cross-env
npm install increase-memory-limit cross-env -g
Step 2.
Add to package.json.
“fix-memory-limit”: “cross-env LIMIT=4096 increase-memory-limit”
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"fix-memory-limit": "cross-env LIMIT=10000 increase-memory-limit"
},
Step 3:
Execute fix memory limit:
npm run fix-memory-limit
Step 4:
Error message: node — Max old space size = 4096 is not an internal or external command
Solution: on node_modules/.Modify “% _prog%” under bin to%_prog%
After the replacement, restart NPM run serve to execute successfully. If the error is still reported and the memory overflows, you can try to increase the 4096
Read More:
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- [Solved] Project Package Error: Javascript heap out of memory
- [Solved] Vue Project Modify Page Error: CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory
- [Solved] Vue Compile Error: JavaScript heap out of memory
- [Solved] Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory
- Vue item packaging error: errno 134 [How to Solve]
- Vue-cli2 sub environment packaging
- Node.js Error: “Error: EBUSY: resource busy or locked, stat“
- [Solved] Nuxt Import qrcodejs2.js / QRCode.js Error: document is not defined
- [Solved] Some chunks are bigger warning on vite packaging
- Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- [Solved] webpack Package Error: ERROR in multi ./src/main.js ./dist/bundle.js Module not found: Error: Can‘t resolv
- node.js yarn Error: SyntaxError: Unexpected string [How to Solve]
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- [Solved] Node.js v17 npm run dev Error: opensslErrorStack
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]
- JS uses onerror to automatically catch exceptions
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- Node.js Error: Cannot find module express [How to Solve]