smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.21k stars 491 forks source link

Unexpected Error-npx hardhat compile in hardhat-starter-kit #110

Closed ajeetk1 closed 1 year ago

ajeetk1 commented 2 years ago

Hi All,

I just found an error when execute npx hardhat compile in hardhat-starter-kit :

"npx hardhat An unexpected error occurred: Error: Cannot find module '@nomiclabs/hardhat-waffle' Require stack:"

I have also added "ry "npm install -D @nomiclabs/hardhat-waffle ethereum-waffle" &

Still same unexpected error.

Thanks

andrejrakic commented 2 years ago

Hi @ajeetk1, can you try to install the packages first after cloning the repo (using yarn or npm i) and then compile contracts using yarn compile or npm compile? Let's try to exclude npx and see if the issue will go away. Thanks

yyc13236 commented 1 year ago

This answer is from Patrck Collins's solidity course.

We need to delete the unwanted config file.

  1. Find it
    npx hardhat --verbose
  hardhat:core:config Loading Hardhat config from /Users/hardhat.config.js
  1. Then Remove it
    rm /Users/hardhat.config.js

    Try yarn hardhat again, this works for me.