npx install ethers (bash errors) #7984
Replies: 1 comment
-
|
Hi! This is a peer dependency conflict between Hardhat v3 and the hardhat-ethers plugin. The Problem:You have:
The versions are incompatible. Solution 1: Use Compatible Versions (Recommended)Downgrade Hardhat to v2 to match the plugin: npm uninstall hardhat
npm install --save-dev hardhat@^2.28.0
npm install --save-dev ethers @nomicfoundation/hardhat-ethersThen try your project again. Solution 2: Use Legacy Peer Deps (Quick Fix)If you want to keep Hardhat v3, use the flag npm suggested: npm install --legacy-peer-deps ethers @nomicfoundation/hardhat-ethersNote: This may cause compatibility issues later. Solution 3: Force Install (Not Recommended)npm install --force ethers @nomicfoundation/hardhat-ethersWarning: This can break things! Best Practice:For new projects, use the latest stable versions together: npm install --save-dev hardhat@^2.28.0
npm install --save-dev ethers@^6.0.0
npm install --save-dev @nomicfoundation/hardhat-ethers@^3.0.0This ensures all packages work together properly. Why This Happens:Hardhat recently released v3, but many plugins (like hardhat-ethers) haven't updated Hope this helps! Let me know if you still get errors. 👍 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys, after typing the command in bash "npx install ethers" I got this errors below, how to fix?
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: hardhat-tutorial@1.0.0
npm error Found: hardhat@3.1.9
npm error node_modules/hardhat
npm error dev hardhat@"^3.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer hardhat@"^2.28.0" from @nomicfoundation/hardhat-ethers@3.1.3
npm error node_modules/@nomicfoundation/hardhat-ethers
npm error peer @nomicfoundation/hardhat-ethers@"^3.0.0" from @nomicfoundation/hardhat-toolbox@4.0.0
npm error node_modules/@nomicfoundation/hardhat-toolbox
npm error dev @nomicfoundation/hardhat-toolbox@"^4.0.0" from the root project
npm error peer @nomicfoundation/hardhat-ethers@"^3.1.0" from @nomicfoundation/hardhat-chai-matchers@2.1.0
npm error node_modules/@nomicfoundation/hardhat-chai-matchers
npm error peer @nomicfoundation/hardhat-chai-matchers@"^2.0.0" from @nomicfoundation/hardhat-toolbox@4.0.0
npm error node_modules/@nomicfoundation/hardhat-toolbox
npm error dev @nomicfoundation/hardhat-toolbox@"^4.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\solid\AppData\Local\npm-cache_logs\2026-02-20T16_03_08_954Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\solid\AppData\Local\npm-cache_logs\2026-02-20T16_03_08_954Z-debug-0.log
Beta Was this translation helpful? Give feedback.
All reactions