致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足 - webpack 示例 Angular 2 [英] FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory - webpack sample Angular 2

查看:29
本文介绍了致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足 - webpack 示例 Angular 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建 webpack 时遇到了 webpack 示例中的问题:

I am facing an issue in webpack sample while getting webpack build:

致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足

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",

推荐答案

每次我遇到同样的错误时,我都设法使用 --max_old_space_size 选项解决了这个问题.

Every single time when i got the same error i managed to solve the issue using the --max_old_space_size option.

我的猜测是 --max_old_space_size=4096 不够(只需使用更高的值),或者该选项没有应用于正确的位置.

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.

我会尝试:

"build": "rimraf dist && node --max-old-space-size=8192 node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail"

这篇关于致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足 - webpack 示例 Angular 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆