-1

When I want to install something under npm then I get an error. I try to fix it so many ways but failed. Here is the error

npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: undefined@undefined
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" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.1.1
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
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\Mazhar\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\Mazhar\AppData\Local\npm-cache\_logs\2022-09-11T23_40_30_606Z-debug-0.log
PS C:\Users\Mazhar\Documents\Alchemy-weekly\nft-marketplace-scratch> 

  • Try installing with `yarn` – Tayyab Sep 12 '22 at 05:52
  • The yarn works correctly but I want to what the problem is problem ```npm``` package manager. Is there any problem in windows with npm like the hardhat installation problem in windows? – Mazharul Hasan Sep 12 '22 at 06:38
  • There must be some npm cache issue or some package version might be doing this. – Tayyab Sep 12 '22 at 07:39
  • I uninstall node and npm with the root folder and cache folder. But nothing will be changed. But in ``` Linux `` everything is working correctly. What is the problem with windows? – Mazharul Hasan Sep 14 '22 at 05:23
  • Does this answer your question? [Fix the upstream dependency conflict installing NPM packages](https://stackoverflow.com/questions/64936044/fix-the-upstream-dependency-conflict-installing-npm-packages) – Liam Apr 21 '23 at 13:29
  • npm will install different packages on different operating systems. Some packages are not required on some OS's – Liam Apr 21 '23 at 13:30

1 Answers1

0

I had the same issue. And in my case the problem was I was installing packages separetely. Then I installed all packages all at once, and it worked fine.

And also, if you have this package, you can remove it: solidity-coverage

Here is how to install packages:

npm install "react-router-dom" "hardhat" "ethers" "@nomicfoundation/hardhat-toolbox" "dotenv" "@nomiclabs/hardhat-ethers" "@openzeppelin/contracts" "@chainlink/contracts" "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-etherscan@^3.0.0" "@types/mocha@^9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "ts-node@>=8.0.0" "typechain@^8.1.0" "typescript@>=4.5.0"

Abdulhakim
  • 620
  • 8
  • 11