NPM CI:为什么在VSCODE终端上没有同行依赖性错误
我有一个反应回购,在执行“ 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有这个问题。通过使用
安装-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 runningci
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