将 sinon-chai 包的项目设置从 v16 升级到 v20.9.0 时,未解决依赖关系

问题描述 投票:0回答:1

我正在为我现有的项目使用节点 v16.14.2。想要升级到 v20 LTS。我已将节点版本设置为20.9.0。并尝试了

npm install
,并得到了下面提到的错误。


npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/sinon
npm ERR!   dev sinon@"6.1.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer sinon@"^1.4.0 || ^2.1.0 || ^3.0.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/sinon-chai
npm ERR!   dev sinon-chai@"^2.8.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/sinon
npm ERR!   peer sinon@"^1.4.0 || ^2.1.0 || ^3.0.0 || ^4.0.0" from [email protected]
npm ERR!   node_modules/sinon-chai
npm ERR!     dev sinon-chai@"^2.8.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

我尝试升级特定的软件包,但没有成功。

sinon-chai
最后一次更新于3年前,是否有任何其他相关包可以解决这个问题或任何其他解决方案。

node.js express dependencies sinon sinon-chai
1个回答
0
投票

sinon-chai
3.2.0 新增对 Sinon 6.x 的支持,参见 sinon-chai/releases/tag/v3.2.0

您应该将

sinon-chai
^2.8.0
更新为
^3.2.0

[email protected]
的对等依赖关系:

$ npm view [email protected] peerDependencies
{ chai: '^4.0.0', sinon: '>=4.0.0 <7.0.0' }

[email protected]
的对等依赖关系:

$ npm view [email protected] peerDependencies
{ chai: '>=1.9.2 <5', sinon: '^1.4.0 || ^2.1.0 || ^3.0.0 || ^4.0.0' }
© www.soinside.com 2019 - 2024. All rights reserved.