【问题标题】:"FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" with npm search“致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足”与 npm 搜索
【发布时间】:2022-02-18 03:50:47
【问题描述】:

我刚刚在 Windows 10 上安装了 npm 3.10.3 和 nodejs v6.3.1,当我第一次使用 npm 搜索时,几分钟后我收到了这条消息:

PS C:\Users\ToOoA> npm search express
npm WARN Building the local index for the first time, please be patient
[..................] | : WARN Building the local index for the first time, please be patient
<--- Last few GCs --->

  397899 ms: Mark-sweep 937.3 (1256.9) -> 936.7 (1263.9) MB, 642.4 / 0 ms (+ 402.5 ms in 1423 steps since start of marking, biggest step 13.5 ms) [all
ocation failure] [GC in old space requested].
  399012 ms: Mark-sweep 936.7 (1263.9) -> 911.2 (1241.1) MB, 1112.5 / 0 ms [allocation failure] [GC in old space requested].
  400136 ms: Mark-sweep 911.2 (1241.1) -> 911.2 (1235.1) MB, 1124.0 / 0 ms [last resort gc].
  401258 ms: Mark-sweep 911.2 (1235.1) -> 911.1 (1229.1) MB, 1121.6 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000000A2635C9E51 <JS Object>
    1: fromString(aka fromString) [buffer.js:194] [pc=000003378855E0D0] (this=000000A263504189 <undefined>,string=00000099AE54CE31 <Very long string[1
96464212]>,encoding=000000A2635D6359 <String[4]: utf8>)
    2: from [buffer.js:94] [pc=000003378855DCF6] (this=000002E9C08A5BB1 <JS Function Buffer (SharedFunctionInfo 000000A2635E3899)>,value=00000099AE54C
E31 <Very long string[196464212]>,encod...

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

谷歌搜索后,我认为它可能来自以前安装的 nodejs 未删除的文件,但我找不到哪些文件。

有人有想法吗?

【问题讨论】:

    标签: javascript node.js npm windows-10


    【解决方案1】:

    请更新到最新版本的 npm,现在已修复搜索。

    npm install -g npm@latest

    【讨论】:

      【解决方案2】:

      这是在 npm 4.0.1 中修复的: https://github.com/npm/npm/issues/14498

      npm -i npm@4.0.1 -g
      npm cache clear
      

      【讨论】:

        猜你喜欢
        • 2016-12-19
        • 1970-01-01
        • 2018-11-10
        • 2018-09-25
        • 1970-01-01
        • 1970-01-01
        • 2018-07-06
        • 2019-12-17
        • 2018-12-05
        相关资源
        最近更新 更多