致命错误:CALL_AND_RETRY_LAST分配失败- JavaScript堆内存不足

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

本文关键字:失败 JavaScript 分配 内存不足 LAST CALL AND RETRY 致命错误      更新时间:2023-09-26

我无法使用npm:

进行任何搜索。
npm search material

. .结果显示以下错误:

npm WARN Building the local index for the first time, please be patient
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

我尝试使用以下命令

npm --max_old_space_size=16384 search material

但是我得到了相同的结果。

npm版本为3.10.3

根据npm的bug跟踪器,这个问题已经在npm@4.0.0中修复了。(见螺纹)。

升级npm后搜索工作正常:

npm install npm@latest -g

(您可能需要在您的系统上使用su/sudo)