【问题标题】:npm ERR! Invalid response body while trying to fetch http://registry.npmjs.org/accepts: Integrity verification failed for shanpm 错误!尝试获取 http://registry.npmjs.org/accepts 时响应正文无效:sha 完整性验证失败
【发布时间】:2021-01-26 04:52:38
【问题描述】:

npm 错误!尝试获取 http://registry.npmjs.org/accepts 时响应正文无效:

的完整性验证失败

我在尝试安装 Angular cli 和 express 时在我的 RPI4 (raspbian) 上收到此错误。我按照另一个线程中的建议降级到 npm 6.13.7,但没有成功。

【问题讨论】:

    标签: npm angular-cli


    【解决方案1】:

    尝试清除缓存并重新安装

    npm 缓存清除 --force

    npm 安装

    【讨论】:

      【解决方案2】:

      npm cache verify
      npm install

      以上对我有帮助。
      在没有--force 键的npm cache clean 命令的输出中查看详细信息。
      在我的情况下是

      $ npm cache clean
      npm ERR! As of npm@5, the npm cache self-heals from corruption issues
      npm ERR! by treating integrity mismatches as cache misses.  As a result,
      npm ERR! data extracted from the cache is guaranteed to be valid.  If you
      npm ERR! want to make sure everything is consistent, use `npm cache verify`
      npm ERR! instead.  Deleting the cache can only make npm go slower, and is
      npm ERR! not likely to correct any problems you may be encountering!
      npm ERR! 
      npm ERR! On the other hand, if you're debugging an issue with the installer,
      npm ERR! or race conditions that depend on the timing of writing to an empty
      npm ERR! cache, you can use `npm install --cache /tmp/empty-cache` to use a
      npm ERR! temporary cache instead of nuking the actual one.
      npm ERR! 
      npm ERR! If you're sure you want to delete the entire cache, rerun this command
      npm ERR! with --force.
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-12-27
        • 2021-01-02
        • 2020-08-06
        • 1970-01-01
        • 2021-10-01
        • 2020-08-12
        • 2021-09-23
        相关资源
        最近更新 更多