Closed banshee closed 1 year ago
could it be that npm do not support the ^
when using alias ?
my template repo works and the line is : "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.10",
I'm facing the same problem. I've tried to use your line like this in my package.json
:
"dependencies": {
"@chainlink/contracts": "^0.2.1",
"@openzeppelin/contracts": "^4.1.0",
"dotenv": "^10.0.0",
"hardhat": "^2.4.1"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.10",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"chai": "^4.3.4",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.4.1",
"hardhat-deploy": "^0.8.11",
"hardhat-gas-reporter": "^1.0.4"
}
Same here
npm ERR! Found: @nomiclabs/hardhat-ethers@0.3.0-beta.10
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR! dev @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.10" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/hardhat-waffle@2.0.1
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"*" from the root project
@nomiclabs/hardhat-waffle@2.0.1
expects @nomiclabs/hardhat-ethers
to be ^2.0.0
but it's "only" 0.3.0-beta.10
.
Thanks for your reports. The best way forward will be to fix the following issue in hardhat: https://github.com/nomiclabs/hardhat/issues/1040
This is what is blocking me from making hardhat-deploy-ethers and extension to hardhat-ethers
feel free to add your comments there
Any progress on this issue or workaround maybe?
Having same issue, any progress?
Encountered the same issue as of now. No update?
@OCWC22 do you have a repo reproducing the issue ?
It is working fine for me in this simple test repo : https://github.com/bug-reproduction/test-hardhat-deploy-ethers
It is working fine for me in this simple test repo : https://github.com/bug-reproduction/test-hardhat-deploy-ethers
Getting the same error in this repo with npm (version 8.3.0) if I delete the package-lock.json
first (otherwise I guess it doesn't do any dependency resolution).
With yarn (version 1.22.11) it works, but I get the following warnings:
warning " > @nomiclabs/hardhat-waffle@2.0.1" has incorrect peer dependency "@nomiclabs/hardhat-ethers@^2.0.0".
warning " > @nomiclabs/hardhat-waffle@2.0.1" has unmet peer dependency "ethereum-waffle@^3.2.0".
warning " > hardhat-deploy@0.9.24" has unmet peer dependency "@ethersproject/hardware-wallets@^5.0.14".
Can confirm, getting the same error
node version: v16.13.2 npm version: 8.1.2
@jannikluhn @outdoteth if you remove the package-lock what is probably happening is that the ^ make it use something else.
Can you try with the specific version specified as mentioned here : https://github.com/wighawag/hardhat-deploy-ethers/issues/13#issuecomment-877578055
@wighawag I still get the same error
rm -rf package-lock.json
rm -rf node_modules
npm install
Here is my package.json
{
"name": "backspread",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "",
"license": "ISC",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.10",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"chai": "^4.3.6",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.5.3",
"hardhat": "^2.8.3",
"hardhat-deploy": "^0.10.1"
}
}
Re warning @jannikluhn
the @nomiclabs/hardhat-ethers@^2.0.0
is probably expected since we are using hardhat-deploy-ethers instead of hardhat-ethers
@ethersproject/hardware-wallets@^5.0.14
is expected as it is an optional peer dependencies
and I suppose the ethereum-waffle
is unrelated to the issue here
@outdoteth thanks for trying out, I ll see if I can reproduce and figure out what is going on
Ok thanks - fwiw it is working on one of my other machines. I am trying to see what is different between them
I just tried and can reproduce, seems like npm do not likes the npm@
when peer dependencies are involved
Note that npm i --force
works in that case though
By the way, the best way froward out of this issue is to have this issue resolved : https://github.com/nomiclabs/hardhat/issues/1040
this would allow me to have hardhat-deploy-ethers be an extension to hardhat-ethers instead of having to install it as alias
Hey
I commented out from hardhat.config.ts:
import "@nomiclabs/hardhat-waffle";
And to my tests added:
import {waffleChai} from '@ethereum-waffle/chai';
use(waffleChai);
And now I can finally use revertedWith assertions in my tests.
This issue seems to come up intermittently for me. Currently it's breaking in our CI after working fine for a few months. I'm having no issues on my local machine.
Run npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nomiclabs/hardhat-waffle@2.0.3
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 @nomiclabs/hardhat-waffle@2.0.3
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.0.6
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/hardhat-waffle@2.0.3
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.2" 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!
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-06-10T22_28_43_327Z-debug-0.log
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
"@nomiclabs/hardhat-waffle": "^2.0.2",
...
"hardhat": "^2.8.4",
"hardhat-deploy": "^0.10.6",
...
This seems to be resolved after I set the node version to 16.15.0
, from 16.15.1
. The changing of the versions may explain the intermittency of the issue for me.
I ran in the same issue just now, after having no problem in the last couple of months (?) But i ended up defining an override which seems to be the "proper" workaround for now:
"devDependencies": {
...
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
...
},
"overrides": {
"@nomiclabs/hardhat-waffle": {
"@nomiclabs/hardhat-ethers": "$@nomiclabs/hardhat-ethers"
}
}
@suicide this override fixed it for me, for now... thanks
I'm not sure exactly what the issue is, but changing "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
to "@nomiclabs/hardhat-ethers": "^2.2.1",
seems to resolve it.
Thanks for your reports. The best way forward will be to fix the following issue in hardhat: NomicFoundation/hardhat#1040
This is what is blocking me from making hardhat-deploy-ethers and extension to hardhat-ethers
feel free to add your comments there
@wighawag Looks like this now can be implemented through hardhat@2.13.0-dev.2 See Pull Request 3498
hardhat-deploy-ethers@next has been released Please, try it out.
It is now an extension to hardhat-ethers so you need both
But note that that new version do not support external artifact if you were using them
I'm trying to use the @next version with 'npm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers@next' but still having the same installation issues. How should we do now with these changes? Thanks
@ivanpajon
You need to install both
npm install --save-dev @nomiclabs/hardhat-ethers hardhat-deploy-ethers@next
and include both of them in hardhat.config.js
:
require('hardhat-deploy`)
....
require('@nomiclabs/hardhat-ethers`)
require('hardhat-deploy-ethers`)
Hey @wighawag
Added hardhat-deploy to my repo a few weeks ago, but now facing issues with installing or updating packages
Install
> npm install --save-dev @nomicfoundation/hardhat-chai-matchers
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @biconomy/account-contracts@2.0.0
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.6
npm ERR! node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR! dev @nomicfoundation/hardhat-chai-matchers@"*" 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.
Update
npm update ethereum-waffle
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nomiclabs/hardhat-waffle@2.0.3
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 @nomiclabs/hardhat-waffle@2.0.3
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.2.3
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/hardhat-waffle@2.0.3
npm ERR! node_modules/@nomiclabs/hardhat-waffle
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
Hey @wighawag
Added hardhat-deploy to my repo a few weeks ago, but now facing issues with installing or updating packages
Install
> npm install --save-dev @nomicfoundation/hardhat-chai-matchers npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: @biconomy/account-contracts@2.0.0 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.6 npm ERR! node_modules/@nomicfoundation/hardhat-chai-matchers npm ERR! dev @nomicfoundation/hardhat-chai-matchers@"*" 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.
Update
npm update ethereum-waffle npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @nomiclabs/hardhat-waffle@2.0.3 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 @nomiclabs/hardhat-waffle@2.0.3 npm ERR! node_modules/@nomiclabs/hardhat-waffle npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project npm ERR! npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.2.3 npm ERR! node_modules/@nomiclabs/hardhat-ethers npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/hardhat-waffle@2.0.3 npm ERR! node_modules/@nomiclabs/hardhat-waffle npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
hey I was running into the same thing, after i used @next it has no more issue anymore, change your hardhat-deploy-ethers version and it should be working