NPM CI:为什么在VSCODE终端上没有同行依赖性错误

发布于 2025-02-05 20:16:15 字数 254 浏览 2 评论 0原文

我有一个反应回购,在执行“ npm ci” 时,我给出了“相互冲突的同行依赖性”问题(使用NPM 8.5.5,节点16.14-alpine)。

这很好,因为npm> = 7块安装同伴依赖性,如果发现任何冲突。

但是我不明白为什么,如果我使用非常相似的版本(NPM 8.5.0和Node V16.14.2)在VSCODE终端中复制“ NPM CI”命令,我看到没有错误并且安装正确完成? : - /

有什么想法吗?

I have a react repo that in a github action , while doing "npm ci", gives a "Conflicting peer dependency" problem ( using npm 8.5.5 , node 16.14-alpine ).

And that's fine because npm >=7 blocks installations of peer dependencies if it finds any conflict.

But I don't understand why, if I replicate the "npm ci" command in my vscode terminal using very similar versions (npm 8.5.0 and node v16.14.2), I see no error and the installation correctly completes? :-/

Any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲欢浪云 2025-02-12 20:16:15

我也有这个问题。通过使用安装-Legacy-Peer-Deps本地和运行CI具有相同标志的情况,事情可以正常工作。我无法回答为什么同行依赖性在我的本地环境中正确安装,而不是使用GitHub操作。我已经验证了我在两个地方都运行了相同的节点版本。看来,如果依赖关系在没有旧标志的情况下在本地安装,则应该在github行动中进行,但这不是我的经验。

npm i - legacy-peer-deps

npm ci - legacy-peer-deps

I have this problem as well. By installing with --legacy-peer-deps locally and running ci with the same flag, things work. I have not been able to answer why peer dependencies install correctly in my local environment but not with Github actions. I have verified that I'm running the same node version in both places. It seems that if dependencies install locally without the legacy flag, they should in Github Actions, but that is not my experience.

npm i --legacy-peer-deps

npm ci --legacy-peer-deps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文