node.js - ng 新给 "npm ERR! code EINTEGRITY required sha1 but found sha512"

标签 node.js angular angular-cli

我正在尝试在 Angular 7 中创建一个新项目,但出现以下错误。

npm ERR! code EINTEGRITY npm ERR! sha1-SKjl7xiAdhfuK14zwRlMNbQ5Ukw= integrity checksum failed when using sha1: wanted sha1-SKjl7xiAdhfuK14zwRlMNbQ5Ukw= but got sha512-3ds0bW0f5xtxepS3MKBqKiG2i93CTT5cG6vlfsoFDIps7lzcSnZweu3t15S90EacDpenHFyAQdpJlCaMpyLROA== sha1-X4ctB1ciOMPTjjyMj8IQXIHbMBU=. (197 bytes)

在我的系统上尝试了所有可能的解决方案,但没有一个能帮助我。

下面是我尝试过的解决方案列表。

  • nmp 安装最新版本
  • 清除缓存
  • 删除node_modules
  • 强制清除缓存
  • 卸载 Angular 并重新安装 Angular

最佳答案

这些错误有时是由于缓存或您的 .lock 文件造成的。 因此,您可以遵循以下一些步骤来解决该问题。

  • 删除node_modules rm -rf node_modules
  • 删除 package-lock.json 文件
  • 清除缓存。 npm 缓存清理 --force
  • 验证缓存npm缓存验证
  • 然后运行npm install --registry https://registry.cnpmjs.org

如果不起作用,请尝试更新正在运行的包管理器

  • npm i -g npm
  • 然后,再次运行 npm install

关于node.js - ng 新给 "npm ERR! code EINTEGRITY required sha1 but found sha512",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55314719/

相关文章:

angularjs - 为我的 angularJS Web 应用程序提供静态内容、nodeJS 还是 apache?

javascript - 如何让 Guard 自动编译我的 Coffeescript 文件?说是但不是

node.js - 使用 mongoose,express 搜索短语

node.js - 模块.js :538 throw err; using angular 4

angular - 在 angular-cli 应用程序中使用 jsonwebtoken 时出错

angular-cli - 具有多个目标的 Architect 命令无法指定覆盖

javascript - Sailsjs websockets 文档去哪儿了?

Angular 7路由连接导致编译错误

angular - 有什么方法可以使用 RxJS 将 n 个 http 请求链接在一起吗?

Angular 如何编写模板驱动表单的跨字段验证指令