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

前端 未结 7 1254
萌比男神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:00

    I got a fix after increasing the node max_old_space. Here is the fix.

    Instead of running npm start or ng start. Run the below command

    node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve
    

    OR

    You can add the command in package.json file as well

    "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve"
    

提交回复
热议问题