我有一个Vue应用程序。当为该应用程序运行Yarn build
时,它失败了,错误为“致命错误:CALL_AND_RETRY_LAST Allocation failed-JavaScript heap out of memory”
纱线服务
不显示任何错误
我已经尝试使用--max_old_space_size,但它不起作用。
Building for production...
<--- Last few GCs --->
[15106:0x104800000] 59679 ms: Scavenge 1309.5 (1404.6) -> 1308.7 (1405.1) MB, 17.1 / 0.0 ms (average mu = 0.183, current mu = 0.186) allocation failure
[15106:0x104800000] 59705 ms: Scavenge 1320.1 (1415.6) -> 1319.2 (1416.1) MB, 11.5 / 0.0 ms (average mu = 0.183, current mu = 0.186) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x0ed65f71e681 <JSObject>
0: builtin exit frame: lastIndexOf(this=0x0ed64fe8cd29 <Very long string[2749756]>,0x0ed684c307e9 <String[1]\: \n>,0x0ed64fe8cd29 <Very long string[2749756]>)
1: z(aka z) [0xed64d5f89f9] [/Users/aracelicanadas/Desktop/unilever/unilever_ui/node_modules/terser/dist/bundle.min.js:1] [bytecode=0xed694d21061 offset=15](this=0x0ed6cad826f1 <undefined>)
2: prepend_comments [0xed64d5f86c1] ...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x10003927a node::Abort() [/usr/local/Cellar/node/10.10.0/bin/node]
2: 0x10003944b node::OnFatalError(char const*, char const*) [/usr/local/Cellar/node/10.10.0/bin/node]
3: 0x1001aca27 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/10.10.0/bin/node]
4: 0x1001ac9c8 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/10.10.0/bin/node]
5: 0x10047f740 v8::internal::Heap::UpdateSurvivalStatistics(int) [/usr/local/Cellar/node/10.10.0/bin/node]
6: 0x1004813b3 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/Cellar/node/10.10.0/bin/node]
7: 0x10047ea79 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/Cellar/node/10.10.0/bin/node]
8: 0x10047d964 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/Cellar/node/10.10.0/bin/node]
9: 0x1004860bf v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/10.10.0/bin/node]
10: 0x100486108 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/10.10.0/bin/node]
11: 0x100465fef v8::internal::Factory::AllocateRawWithImmortalMap(int, v8::internal::PretenureFlag, v8::internal::Map*, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/10.10.0/bin/node]
12: 0x100467dbf v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/Cellar/node/10.10.0/bin/node]
13: 0x10054c801 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/local/Cellar/node/10.10.0/bin/node]
14: 0x1005679f4 v8::internal::String::LastIndexOf(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [/usr/local/Cellar/node/10.10.0/bin/node]
15: 0x10024a531 v8::internal::Builtin_Impl_StringPrototypeLastIndexOf(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/Cellar/node/10.10.0/bin/node]
16: 0x354b4c8dc17d
17: 0x354b4c8918b5
18: 0x354b4d494285
19: 0x354b4d43de3c
20: 0x354b4c88a5a3
⠙ Building for production...
更新或使用更大的堆内存大小不会解决问题的根源。
根源在于您可能在package.json
文件中包含了无限循环依赖项。
如果您的包名为“anawesomePackage”,并且在它的package.json依赖项中,您将其自身列为依赖项,则可能会发生这种情况,如下所示:
package.json:
{
"name": "anAwesomePackage",
...
"dependencies": {
"anAwesomePackage": "latest"
}
}
NPM
足够聪明,可以计算出要做什么,而Yarn
则不是。
尝试使用https://github.com/endel/regene-memory-limit增加大小限制,但仍然无法构建。我需要更改node_modules中的任何地方吗? 10%构建模块6/8模块2活动...\bootstrap\dist\css\bootstrap 90%块资产处理<---最后几个GCs---> 174152 ms:标记-扫描1266.2(1435.6)->1265.2(1
我想在angular 2中创建build,我写了 命令,并得到以下错误。 我还在我项目中尝试了以下命令: 并得到以下错误: 错误:eNoent:没有这样的文件或目录,lstat'tsconfig-aot.json'的错误(本机)位于object.main(/root/desktop/rc1-dev/client/node_modules/@angular/tsc-wrapped/src/main.
我一直在使用G1垃圾收集器经历Java VM崩溃。我们得到使用以下签名生成的hs_err_pid.log文件:
我在运行应用程序时遇到gradle生成错误。我使用的是8GB内存的windows 10,Android studio 4.0.1版 内存不足:Java堆空间。请在项目的Gradle中为Gradle分配更多内存。属性文件。例如,下面的一行,在渐变中。属性文件,将最大Java堆大小设置为1024 MB:org。格雷德尔。jvmargs=-Xmx1024m 即使遵循相同的步骤,我也无法运行该应用程序。有
<---JS StackTrace---> =====JS栈迹=================================================================== 安全上下文:0369632D1:create(This=036856A9)2:_Walk[034841A1:~764][PC=1CCAED1F](This=3A11A619,Visitor=3BCEFD
问题:我运行< code>mvn全新安装-dskipstest 并得到 更多信息: > < li> 操作系统:OS X (16 GB内存) Java配置:位于< code > ~/Libraries/Preferences/intelli jide a13/Idea . vmoptins 和< code > Applications/IntelliJ \ Idea \ 13.app/bin/ide