npm build gives “Ineffective mark-compacts near heap limit Allocation failed”

前端 未结 7 1134
萌比男神i
萌比男神i 2021-02-05 08:44

I have a reactjs/typescript project, running on windows 10. Im trying to build by ts-scripts with

\"rimraf ../wwwroot/* && react-scripts-ts build

7条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 09:12

    I have been facing this problem for some time. The problem is most likely caused by a dependancy or component which is a large .js file. I am currently using this package to successfully fix the issue.

    You basically install it globally:

    npm install -g increase-memory-limit
    

    And then from within your project root you run:

    increase-memory-limit
    

    Which will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.

提交回复
热议问题