ng build --prod时报FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed -错误

    xiaoxiao2025-06-14  13

    ng build时没有问题,但是 ng build --prod就会报以下错误

    FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

    2020年3月8日 更新解决办法

    使用了increase-memory-limit,但是还是没有效果,使用以下命令代替ng build --prod --build-optimizer后,解决问题

    node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer

    2019年5月26日

    参考https://blog.csdn.net/qq_39209832/article/details/88350975 可以解决。

    命令行cmd ,dos窗口运行:

    npm install -g increase-memory-limit

    进入项目文件夹,运行:

    increase-memory-limit
    最新回复(0)