Even after adding the hardhat packages by yarn multiple times, node modules are not showing in the folder. enter image description here What am I doing wrong?

1 Answer 1


You should initialize the project before installing the packages.

This should be the order to install hardhat through yarn.

yarn init -y 
yarn add --dev hardhat 
npx hardhat

If it doesn't work, you can try install using the npm.

npm init -y
npm install --save-dev hardhat
npx hardhat

For more information you can click here.

Tell me if it helps!

  • 1
    Thank you so much mate, it works now!!
    – absng842
    Commented Sep 15, 2022 at 9:50

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.