gpt4 book ai didi

javascript - npx create-react-app fatal error : JavaScript heap out of memory

转载 作者:行者123 更新时间:2023-12-04 07:22:12 24 4
gpt4 key购买 nike

尝试使用 npx create-react-app 评估为 react 应用程序创建样板

D:\React>create-react-app assessment

Creating a new React app in D:\React\assessment.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

[ ........] | reify:color-convert: timing reifyNode:node_modules/jest-validate/node_modules/color-convert Comp

#
# Fatal error in , line 0
# Fatal process out of memory: Zone
#
#
#
#FailureMessage Object: 000000888EBFA4C0[ ........] / reify:color-convert: timing reifyNode:node_modules/jest-s[ ........] / reify:color-convert: timing reifyNode:node_modules/jest-snapshot/node_modules/color-convert Comp
<--- Last few GCs --->

[7756:000001A77FCE9290] 304467 ms: Scavenge 239.7 (274.6) -> 239.1 (274.6) MB, 2.8 / 0.0 ms (average mu = 0.996, current mu = 0.999) allocation failure
[7756:000001A77FCE9290] 306201 ms: Scavenge 239.8 (274.6) -> 239.3 (274.6) MB, 186.4 / 181.9 ms (average mu = 0.996, current mu = 0.999) allocation failure
[7756:000001A77FCE9290] 307086 ms: Scavenge 240.1 (274.6) -> 239.6 (274.6) MB, 3.9 / 0.1 ms (average mu = 0.996, current mu = 0.999) allocation failure


<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 00007FF647760366]
1: StubFrame [pc: 00007FF647761333]
2: StubFrame [pc: 00007FF647732BAD]
Security context: 0x0364ad71a299 <JSObject>
3: replace [00000364AD709699](this=0x03c776effa81 <String[175]\: [\x1b[7m \x1b[27m\x1b[90m........\x1b[0m] / reify:color-convert: \x1b[32;40mtiming\x1b[0m \x1b[35mreifyNode:node_modules/jest-snapshot/node_modules/color-convert\x1b[0m Completed in 194645ms>,0x03b334...

FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting assessment/ from D:\React
上面的痕迹来自 CMD,也尝试过使用管理员权限,但仍然是同样的问题。
还尝试通过 npm clean cache --force 清理 NPM 缓存但问题依然存在,
如果有人可以提供帮助!
使用节点版本 12.2.0 和 npm 版本 7.20.0

最佳答案

This answer看起来它可能是相关的。
不过,如果可能的话,我建议您先将您的 NodeJS 版本升级到最新的 12.x 或最高 14.x。
您还需要确保获得最新的 create-react-app因为问题可能出在 NodeJS 的旧版本上与 create-react-app 冲突.
在您更新内容后,我会使用 npx create-react-app assessments来自 create-react-app guide创建您的应用程序以查看进展情况。

关于javascript - npx create-react-app fatal error : JavaScript heap out of memory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68423739/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com