FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 解决方法

随着前端项目代码越来越臃肿,项目编译运行,热更新启动的时候,时常会出现 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 这样的报错。

image


解决方法:在项目依赖包 node_modules.bin目录的 webpack-dev-server.cmd 文件中添加 --max-old-space-size=4096


image


当然size你可以根据自己需求更改到合适大小。

猜你喜欢

转载自blog.csdn.net/weixin_42927679/article/details/128788897