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

前端 未结 7 1131
萌比男神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.

    0 讨论(0)
提交回复
热议问题