npm ERR! code EINTEGRITY npm ERR! Integrity checksum failed when using sha512:

604 阅读1分钟

npm install发生报错如下: image.png

这是一个 npm 包完整性检查失败的问题。可以尝试以下方案

  1. 完全清理环境:
# 删除所有可能影响的缓存和文件
rm -rf node_modules
rm -rf ~/.npm
rm package-lock.json
rm yarn.lock
  1. 如果上述方法仍然不行,可以尝试修改 .npmrc 文件
registry=https://registry.npmmirror.com/
strict-ssl=false
legacy-peer-deps=true
package-lock=false