问题
I am facing an issue in webpack sample while getting webpack build:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
package.json
"build": "rimraf dist && node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail",
回答1:
Every single time when i got the same error i managed to solve the issue using the --max_old_space_size
option.
My guess would be that either --max_old_space_size=4096
is not enough (just use a higher value) or that the option is not applied in the right place.
I would try:
"build": "rimraf dist && node --max-old-space-size=8192 node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail"
来源:https://stackoverflow.com/questions/44068494/fatal-error-call-and-retry-last-allocation-failed-javascript-heap-out-of-memo