FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 000000A5...... <JSObject>
1: fromString(aka fromString) [buffer.js:314] [bytecode=0000...... <String[4]: utf8>)
2: from [buffer.js:177] [bytecode=000.......
ong string[1...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node_module_register
2: v8::internal::FatalProcessOutOfMemory
3: v8::internal::FatalProcessOutOfMemory
4: v8::internal::Factory::NewRawTwoByteString
5: v8::internal::Smi::SmiPrint
6: v8::internal::StackGuard::HandleInterrupts
7: v8::String::WriteUtf8
8: v8::internal::wasm::AsmType::Extern
9: node::Buffer::New
10: node::Buffer::New
11: v8::internal::wasm::SignatureMap::Find
12: v8::internal::Builtins::CallableFor
13: v8::internal::Builtins::CallableFor
14: v8::internal::Builtins::CallableFor
15: 000003F46D4843C1
解决办法:
https://www.cnblogs.com/chenchunbo/p/16395544.html
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
是因为node内存溢出导致。
安装increase-memory-limit插件
(1)全局安装
npm install -g increase-memory-limit
(2)接着执行=》 完美解决 重新运行项目即可:
increase-memory-limit
(3)【测试】然后在node_modules 文件夹内搜索webpack.cmd
选择 webpack.cmd
文件,右键,选择编辑,查看是否更改成功?
出现10240 字样 ,说明已经更改成功!
你会发现它自动给node添加了内存限制,如图:
@IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe --max-old-space-size=10240" "%~dp0\..\webpack\bin\webpack.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node --max-old-space-size=10240 "%~dp0\..\webpack\bin\webpack.js" %* )
node --max-old-space-size=10240
解决了内容溢出的问题