严重错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足。

3

我无法使用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


2
我曾经在一个Node脚本中遇到过类似的问题,我使用了以下这些标志:node --max_old_space_size=8192 --optimize_for_size --max_executable_size=4096 --stack_size=4096 .。希望这能帮到你。 - user5466293
1个回答

3
根据npm的错误跟踪器,这个问题已经在npm@4.0.0中得到解决。(参见thread)。在升级npm后,我的搜索正常工作:

npm install npm@latest -g

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接