wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

Getting "could not resolve" when installing other packages #410

Closed n00b21337 closed 1 year ago

n00b21337 commented 1 year ago

So this are steps to reproduce this problem

  1. Install hh toolbox npm install --save-dev @nomicfoundation/hardhat-toolbox
  2. Install hh deploy npm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers
  3. Install something else like npm i @chainlink/contracts

and each time in step 3 I get

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @nomicfoundation/hardhat-chai-matchers@1.0.5
npm ERR! Found: @nomiclabs/hardhat-ethers@0.3.0-beta.13
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   dev @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.13" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-chai-matchers@1.0.5
npm ERR! node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!   peer @nomicfoundation/hardhat-chai-matchers@"^1.0.0" from @nomicfoundation/hardhat-toolbox@2.0.1
npm ERR!   node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!     dev @nomicfoundation/hardhat-toolbox@"^2.0.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.2.2
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-chai-matchers@1.0.5
npm ERR!   node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!     peer @nomicfoundation/hardhat-chai-matchers@"^1.0.0" from @nomicfoundation/hardhat-toolbox@2.0.1
npm ERR!     node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!       dev @nomicfoundation/hardhat-toolbox@"^2.0.1" from the root project
npm ERR! 

which I can resolve by manually putting back package.json to "@nomiclabs/hardhat-ethers": "^2.2.2", and then again back to after installation is done "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",

So I wonder if I could do this somehow without this problems or is this the only way to solve the problem until hardhat-deploy-ethers is direct extension of @nomiclabs/hardhat-ethers ?

wighawag commented 1 year ago

I just published hardhat-deploy-ethers@next which is now an extension to @nomiclabs/hardhat-ethers

Please have a go with it. Note that this version currently do not support external artifact for getContract

BoilingSoup commented 1 year ago

Can the Installation README be updated? Current instructions lead to breakage. @next version is working

mv3n0m commented 1 year ago

@wighawag Still facing the same issue. Isn't there any way to bypass this obstacle?

"npx hardhat" used to install all the @nomicfoundation dependencies separately. Now, everything is bundled into @nomicfoundation/hardhat-toolbox.

I see this as a problem in installing hardhat-deploy-ethers and hence unable to use this repo at all.

wighawag commented 1 year ago

hardhat-deploy-ethers v0.4.1 is out

Note that it @nomicfoundation/hardhat-toolbox is causing issue for plugin type extension and so you ll need to install the dependencies yourself

See doc : https://github.com/wighawag/hardhat-deploy-ethers/#readme