![](/img/trans.png)
[英]npx create-react-app fatal error: JavaScript heap out of memory
[英]Increase JavaScript Heap size in create-react-app project
Node通過傳入--max-old-space-size
命令行標志來增加堆大小。 在create-react-app項目中,一切都取決於react-scripts的使用。 如何在這些項目中傳遞此參數,我應該在哪里做到最好?
謝謝你的幫助。
非常感謝@ dan-abramov,他的評論就是答案! (如果你遇到這個問題,請給他投票)。
你可以把例如node --max_old_space_size=4096 node_modules/.bin/react-scripts start
到那里而不是react-scripts start
"build": "react-scripts --max_old_space_size=4096 build"
這應該工作
一行答案,在終端上運行 - > export NODE_OPTIONS=--max_old_space_size=4096
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.