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

前端 未结 7 1255
萌比男神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 08:49

    I don't think that the solution is to increase memory limit. This way the issue is always postponed.

    I've encounter this issue 2 times. I've solved, for each time:

    1. using a specific version of node (v12.11.1, react v16.13.1 and react-scripts v3.2.0);
    2. switching from npm to yarn (node v12.11.1, react v16.13.1 and react-scripts v3.4.1).

    In addition, check your package.json, delete package-lock.json, remove node-modules folder and try to install your dependencies again.

    Next try to build your project.

提交回复
热议问题