0

Can anyone break down how to successfully set up a hardhat project on windows? I keep running into the HH12 error: "Error HH12: Trying to use a non-local installation of Hardhat, which is not supported. Please install Hardhat locally using npm or Yarn, and try again."

My understanding is that it is a Windows problem, but I haven't found any comprehensive instructions to solve this error. I've tried all the solutions I found online, but none work.

Any tips? Thanks!

2
  • start a new npm project. with npm init -yand then run npm install --save-dev hardhat
    – Majd TL
    Commented Feb 8, 2022 at 12:23
  • You can just start from my hardhat-template. Commented Aug 7, 2022 at 17:55

2 Answers 2

0

When I run npm install --save-dev hardhat I also get a peer dependency issue. Anyone able to solve the issue?

Conflicting peer dependency: @nomiclabs/[email protected]
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomiclabs/[email protected]
npm ERR!   node_modules/@nomiclabs/hardhat-waffle
npm ERR!     dev @nomiclabs/hardhat-waffle@"^2.0.3" from the root project
1
  • This just means you didnt install it locally before and there are some conflicts in your node modules tree. Easiest option is just to move your project to a different directory which is not in the same structure of the node_modules directory and start again
    – CathalMF
    Commented Jan 30, 2023 at 11:47
0

Probably it is legacy deps issue. The ethers library is sometimes conflicting.

Use command npm install --save-dev hardhat --legacy-peer-deps

--legacy-peer-deps: ignore all peer dependencies when installing, in the style of npm version 4 through version 6.

Other solution is to probably use yarn instead of npm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.