Unexpected Error-npx hardhat compile in hardhat-starter-kit
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
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
This answer is from Patrck Collins's solidity course.
We need to delete the unwanted config file.
- Find it
npx hardhat --verbose
hardhat:core:config Loading Hardhat config from /Users/hardhat.config.js
- Then Remove it
rm /Users/hardhat.config.js
Try yarn hardhat again, this works for me.