hardhat-ethernal: 0.8.1 install error: Could not resolve dependency @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.10"

Console log:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: hardhat-project@undefined
npm ERR! Found: @nomiclabs/hardhat-ethers@2.0.5
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   dev @nomiclabs/hardhat-ethers@"^2.0.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.10" from hardhat-ethernal@0.8.1
npm ERR! node_modules/hardhat-ethernal
npm ERR!   dev hardhat-ethernal@"^0.8.1" 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.

package.json:

{
  "name": "hardhat-project",
  "devDependencies": {
    "@nomiclabs/hardhat-ethers": "^2.0.5",
    "@nomiclabs/hardhat-waffle": "^2.0.3",
    "chai": "^4.3.6",
    "dotenv": "^16.0.0",
    "ethereum-waffle": "^3.4.0",
    "ethers": "^5.5.4",
    "hardhat": "^2.9.0",
    "hardhat-contract-sizer": "^2.5.0",
    "hardhat-gas-reporter": "^1.0.8",
    "hardhat-ethernal": "^0.8.1"
  },
  "dependencies": {
    "@openzeppelin/contracts": "^4.5.0"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Closing this for now, feel free to comment/reopen if the problem is still here.

I’ve pushed a new version: 3.2.3 that should fix the issue. Please, let me know if that works

Hey, it’s been a while on this one - possible to fix so force or legacy-peer-deps aren’t needed? I see the config typings have made their way into Hardhat, perhaps that’s relevant, not 100% sure.

Thanks for the ping! I started to work on it. Packages upgrade seem to be more complex than what I thought though

Same issue with hardhat@2.12.1 , i dont want to use force

$ npm i -D hardhat-ethernal

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: hardhat-project@undefined
npm ERR! Found: @nomiclabs/hardhat-ethers@2.2.1
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-chai-matchers@1.0.4
npm ERR!   node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!     peer @nomicfoundation/hardhat-chai-matchers@"^1.0.0" from @nomicfoundation/hardhat-toolbox@2.0.0
npm ERR!     node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!       dev @nomicfoundation/hardhat-toolbox@"^2.0.0" from the root project
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-toolbox@2.0.0
npm ERR!   node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!     dev @nomicfoundation/hardhat-toolbox@"^2.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev hardhat-ethernal@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@0.3.0-beta.13
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.10" from hardhat-ethernal@3.0.1
npm ERR!   node_modules/hardhat-ethernal
npm ERR!     dev hardhat-ethernal@"*" 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 C:\Users\{user}\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\{user}\AppData\Local\npm-cache\_logs\2022-12-05T16_20_25_332Z-debug-0.log

I installed with npm install --legacy-peer-deps and got it to work. Probably not ideal, but should work until things are resolved.

Console log:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: hardhat-project@undefined
npm ERR! Found: @nomiclabs/hardhat-ethers@2.0.5
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   dev @nomiclabs/hardhat-ethers@"^2.0.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.10" from hardhat-ethernal@0.8.1
npm ERR! node_modules/hardhat-ethernal
npm ERR!   dev hardhat-ethernal@"^0.8.1" 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.

package.json:

{
  "name": "hardhat-project",
  "devDependencies": {
    "@nomiclabs/hardhat-ethers": "^2.0.5",
    "@nomiclabs/hardhat-waffle": "^2.0.3",
    "chai": "^4.3.6",
    "dotenv": "^16.0.0",
    "ethereum-waffle": "^3.4.0",
    "ethers": "^5.5.4",
    "hardhat": "^2.9.0",
    "hardhat-contract-sizer": "^2.5.0",
    "hardhat-gas-reporter": "^1.0.8",
    "hardhat-ethernal": "^0.8.1"
  },
  "dependencies": {
    "@openzeppelin/contracts": "^4.5.0"
  }
}

I faced the same error and I fixed installing: “@nomiclabs/hardhat-ethers”: “npm:hardhat-deploy-ethers@^0.3.0-beta.13”. If you are working using Linux (like me), you can get another error (not on MacOS) about keytar. In that case you need to run: sudo apt-get install libsecret-1-dev. Then, if you run npm i (with hardhat-ethernal 0.8.1), it works.

Are you using npm or yarn?

If npm, can you run npm install --force?