`expo-updates` fails to install


I’m trying to add expo-updates to an existing (non-Expo) React Native project.

As per the documentation, I first run

npx install-expo-modules

to add the base expo module and make the required changes to the project setup. This runs successfully. I then try to run

yarn add -E expo-updates

but this fails with

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Googling the error, the solution seemed to be to increase the max memory of Node, which I tried:

export NODE_OPTIONS="--max_old_space_size=8192"

and verified using

node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'

which prints 8240

This is a lot more than the default setting, and should be enough to install a node package.

I’ve also tried with multiple node versions, 14.15.4, 14.19.0, 16.13.2, 17.5.0 but none of them works.

I also had a colleague try, and he had the same issue. We can install other packages just fine.

Any pointers/help would be much appreciated.

Full stack trace:

yarn add v1.22.17
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...

<--- Last few GCs --->

[96957:0x7f7a08900000]   197269 ms: Mark-sweep 8081.0 (8239.0) -> 8064.3 (8239.6) MB, 6110.2 / 0.0 ms  (average mu = 0.342, current mu = 0.203) allocation failure scavenge might not succeed
[96957:0x7f7a08900000]   205488 ms: Mark-sweep 8077.7 (8239.8) -> 8070.0 (8244.8) MB, 8172.8 / 0.0 ms  (average mu = 0.172, current mu = 0.006) allocation failure GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10760b685 node::Abort() (.cold.1) [/usr/local/bin/node]
 2: 0x1061ed5d9 node::Abort() [/usr/local/bin/node]
 3: 0x1061ed74f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 4: 0x10636ef17 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0x10636eeb3 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 6: 0x1065136e5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 7: 0x10651203f v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0x10651e6b0 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 9: 0x10651e731 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x1064eb8f7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
11: 0x1068cf14f v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x106c8d8f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
[1]    96957 abort      yarn add -E expo-updates

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.