question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERESOLVE unable to resolve dependency tree while installing typechain @typechain/hardhat @typechain/ethers-v5

See original GitHub issue

Hi all,

I’ve tried to install like in the readme file with the command npm install --save-dev typechain @typechain/hardhat @typechain/ethers-v5 and I’ve got this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: typechain@3.0.0
npm ERR! node_modules/typechain
npm ERR!   typechain@"^3.0.0" from @ethereum-waffle/compiler@3.4.0
npm ERR!   node_modules/@ethereum-waffle/compiler
npm ERR!     @ethereum-waffle/compiler@"^3.4.0" from ethereum-waffle@3.4.0
npm ERR!     node_modules/ethereum-waffle
npm ERR!       peer ethereum-waffle@"^3.2.0" from @nomiclabs/hardhat-waffle@2.0.1
npm ERR!       node_modules/@nomiclabs/hardhat-waffle
npm ERR!         dev @nomiclabs/hardhat-waffle@"^2.0.1" from the root project
npm ERR!       1 more (the root project)
npm ERR!   peer typechain@"^3.0.0" from @typechain/ethers-v5@2.0.0
npm ERR!   node_modules/@typechain/ethers-v5
npm ERR!     @typechain/ethers-v5@"^2.0.0" from @ethereum-waffle/compiler@3.4.0
npm ERR!     node_modules/@ethereum-waffle/compiler
npm ERR!       @ethereum-waffle/compiler@"^3.4.0" from ethereum-waffle@3.4.0
npm ERR!       node_modules/ethereum-waffle
npm ERR!         peer ethereum-waffle@"^3.2.0" from @nomiclabs/hardhat-waffle@2.0.1
npm ERR!         node_modules/@nomiclabs/hardhat-waffle
npm ERR!         1 more (the root project)
npm ERR!     dev @typechain/ethers-v5@"*" from the root project
npm ERR!   1 more (the root project)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @typechain/hardhat@"*" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: typechain@5.0.0
npm ERR! node_modules/typechain
npm ERR!   peer typechain@"^5.0.0" from @typechain/hardhat@2.0.2
npm ERR!   node_modules/@typechain/hardhat
npm ERR!     dev @typechain/hardhat@"*" 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 /Users/MY_WORKSPACE/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/MY_WORKSPACE/.npm/_logs/2021-06-21T21_07_39_358Z-debug.log

what should I do? the hardhat project is brand new

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
abazlintoncommented, Oct 10, 2021

--force alone didn’t work for me. I’m using the latest hardhat (2.6.5) and latest typechain hardhat plugin (2.3.0).

But this article helped -

https://www.carlrippon.com/upgrading-npm-dependencies/

So I used npm outdated to investigate. Which reported -

Package Current Wanted Latest Location
@typechain/ethers-v5 2.0.0 2.0.0 7.1.2 node_modules/@typechain/ethers-v5
typechain 3.0.0 3.0.0 5.1.2 node_modules/typechain

Then -

npm install --force typechain@latest
npm install @typechain/ethers-v5@latest

So far so good. YMMV

@chubbyavo seem to have detected the source of the problem.

1reaction
chubbyavocommented, Jul 5, 2021

Don’t ask me why but the whole problem was because when I did npm install it installed old packages not compatible one with another

I’m seeing the same error. How did you resolve the issue? To me, this looked like @ethereum-waffle/compiler@3.4.0 would need to update its @typechain/ethers-v5 version (or I need to use a lower version of typechain…).

just remove all the libraries, clean you npm_mobules and reinstall the using the latest one

Hmm, I think the problem is that @ethereum-waffle/compiler@3.4.0 is the latest version. I ended up just force installing and it worked fine. Thanks though!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERESOLVE unable to resolve dependency tree while ...
So try running the following options one by one. 1. Remove node_modules and package-lock.json and then run npm install.
Read more >
(Solved) ERESOLVE unable to resolve dependency tree while ...
So try running the following options one by one. 1. Remove node_modules and package-lock.json and then run. npm install. HTML.
Read more >
"Unable to resolve dependency tree" error during NPM install ...
I have some experience with npm in the past, though I've never been good at troubleshooting it. npm ERR! code ERESOLVE npm ERR!...
Read more >
How to Fix npm ERR ERESOLVE Unable to Resolve ...
#20: peerDependencies in package. · How to install Python Libraries in Visual Studio Code · Unable to resolve dependency tree error when ......
Read more >
[Solved] npm ERR! ERESOLVE unable to resolve ... - YouTube
solution at:https://www.readdy.net/Notes/Details/2135Error messages:⠸ Installing packages (npm)...npm ERR! code ERESOLVEnpm ERR! ERESOLVE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found