0

On compiling, I’m getting this:

$ yarn hardhat compile

yarn run v1.22.22

$ "C:\Users\HP FOLIO\.vscode\MyHotel\node_modules\.bin\hardhat" compile

Nothing to compile
Done in 3.66s.

Here is the GitHub repo.

1 Answer 1

1

That’s because your contracts are already compiled and the corresponding artifacts are being created in the artifacts folder.

So, if you haven’t done any change to any of your contracts and keep compiling, then it’ll keep showing Nothing to compile.

If you want to do a fresh compilation, then you must delete the existing artifacts that you can directly achieve by executing this command:

yarn hardhat clean

Now, when you compile using yarn hardhat compile, it’ll compile all the contracts and create a new artifacts folder containing the artifacts corresponding to the latest compiled contracts.

5
  • It has not compiled. I don't have an artifact folder Commented Oct 13 at 1:26
  • I am getting this error now Error: Cannot find module '@nomicfoundation/hardhat-ethers/types' Commented Oct 13 at 1:59
  • Your project is not initialized as a Hardhat project, therefore missing several required dependencies. Also, you're using the name of the token contract as MegaERC20, but you've imported it as IHotelToken, so I've corrected that as well. After doing these changes, I've created a PR. Commented Oct 13 at 16:56
  • After merging the PR, you can install the dependencies using yarn install and then the contracts would be compiled successfully using yarn hardhat compile command. Commented Oct 13 at 16:57
  • It is still showing Error: Cannot find module '@nomicfoundation/hardhat-ethers/types' And I am inside hardhat project Commented Oct 13 at 18:20

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.