【问题标题】:NGRX - How do I fix "Errors were found in your package-lock.json"?NGRX - 如何修复“在您的 package-lock.json 中发现错误”?
【发布时间】:2021-03-25 12:50:04
【问题描述】:

我在带有 NGRX 的 NX 工作区中使用 Angular,并希望在 Jenkins 中构建它,但在运行 npm install 后出现错误。

任何人在运行后都会看到这样的错误: nx update && 然后npm run audit ??

npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run  npm install  to fix them.
npm ERR!     Invalid: lock file's @ngrx/schematics@10.1.0 does not satisfy @ngrx/schematics@10.0.0
npm ERR!     Invalid: lock file's @ngrx/store-devtools@10.1.0 does not satisfy @ngrx/store-devtools@10.0.0

实际应用运行良好 - 使用 nx serve

我想修复错误,以便运行我的 Jenkins 作业。 有什么建议吗?

【问题讨论】:

    标签: angular npm ngrx package.json


    【解决方案1】:

    如您所见,package.jsonpackage-lock.json 之间存在版本差异。

    删除package-lock.json 并再次运行npm i

    【讨论】:

    • 我已经尝试删除节点模块和 json 文件。没有任何区别。
    • 你是对的。问题是在开发依赖项和正常依赖项中都加载了相同的模块,并且它们具有不同的版本。我删除了不匹配的那个并运行 npm install 并解决了这个问题。谢谢
    猜你喜欢
    • 2022-01-12
    • 2020-09-24
    • 1970-01-01
    • 2018-10-23
    • 2017-11-16
    • 2019-06-27
    • 2020-10-03
    • 2019-09-08
    • 1970-01-01
    相关资源
    最近更新 更多