vue2+webpak node内存溢出?

遇到的问题:项目第一次运行时,没问题不报错,然后保存项目,热更新重新加载时,导致项目断开,需要重新运行,
已经设置了set NODE_OPTIONS=--max_old_space_size但是不起作用,请问是什么原因呢?
vue2+webpak node内存溢出?
报错信息如下:

<--- Last few GCs --->

[5444:0000021A0622F5E0] 88389 ms: Mark-sweep 1304.4 (1369.4) -> 1304.3 (1366.9) MB, 576.3 / 0.1 ms (average mu = 0.134, current mu = 0.000) last resort GC in old space requested

Security context: 0x00142661e6e1 <JSObject>

1: byteLength [00000366D6706169] [buffer.js:~509] [pc=000000D5D3C15DEA](this=0x02f8aa8df8e1 <JSFunction Buffer (sfi = 000002D33DA93E39)>,string=0x0354b9fdb969 <Very long string[32607900]>,encoding=0x00cd12b826f1 <undefined>)

2: arguments adaptor frame: 1->2

3: size [00000299A66308D1] [E:\newGitlab\datagov-front\node_modules\_webpack-sources@1.4...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

1: 00007FF71F800EFA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810

2: 00007FF71F7DA296 node::MakeCallback+4518

3: 00007FF71F7DAC80 node_module_register+2160

4: 00007FF71FA709BE v8::internal::FatalProcessOutOfMemory+846

5: 00007FF71FA708EF v8::internal::FatalProcessOutOfMemory+639

6: 00007FF71FFAE954 v8::internal::Heap::MaxHeapGrowingFactor+11476

7: 00007FF71FFAC6E8 v8::internal::Heap::MaxHeapGrowingFactor+2664

8: 00007FF71FB4F0CB v8::internal::Factory::AllocateRawWithImmortalMap+59

9: 00007FF71FB51BCD v8::internal::Factory::NewRawTwoByteString+77

10: 00007FF71FD65C58 v8::internal::Smi::SmiPrint+536

11: 00007FF71FA63ECB v8::internal::StringHasher::UpdateIndex+219

12: 00007FF71FA8A066 v8::String::Utf8Length+22

13: 00007FF71F7C310C node::Buffer::New+4428

14: 000000D5D25879E0

PS E:\newGitlab\datagov-front> node --max_old_space_size=4096 script.js

internal/modules/cjs/loader.js:583

throw err;

^

Error: Cannot find module 'E:\newGitlab\datagov-front\script.js'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)

at Function.Module._load (internal/modules/cjs/loader.js:507:25)

at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)

at startup (internal/bootstrap/node.js:283:19)

at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

以上是 vue2+webpak node内存溢出? 的全部内容, 来源链接: utcz.com/p/934215.html

回到顶部