build react项目提示错误信息
<--- Last few GCs --->
[1118:0x104c00000] 210060 ms: Scavenge (reduce) 2020.9 (2049.8) -> 2020.1 (2051.3) MB, 3.4 / 0.0 ms (average mu = 0.148, current mu = 0.006) allocation failure
[1118:0x104c00000] 213180 ms: Mark-sweep (reduce) 2021.0 (2050.3) -> 2020.1 (2051.3) MB, 3117.6 / 0.0 ms (average mu = 0.089, current mu = 0.010) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x101319fc5 node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x1000b6169 node::Abort() [/usr/local/bin/node]
3: 0x1000b62df node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
4: 0x100200ba7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x100200b43 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
解决办法:
1.安装increase-memory-limit
npm install -g increase-memory-limit
2.安装成功后执行
increase-memory-limit
3.执行成功后重新npm run build 就OK了
|