npx hardhat doesnt creates a new project

1.6k Views Asked by At

I tried creating a new hardhat project. I tried the following commands in terminal.

npm init --yes
npm install --save-dev hardhat

But when I use the following command

npx hardhat

I am getting the following enter image description here

I think hardhat have changed the contents. Couldnt find anything in the official document.

Can someone suggest how to create a new project using hardhat.

Edit: Contents of the folder

enter image description here

2

There are 2 best solutions below

1
On

run

$ npx hardhat --verbose

You will get the location of a hardhat config file like this:

$ hardhat:core:config Loading Hardhat config from /home/lyon/hardhat.config.js +0ms

Delete it and run npx hardhat again

0
On

That happens when you are trying to create a hardhat project inside a hardhat project. The same happened to me and I realized that in the parent directory I already had hardhat.config.js file. I had to remove that config file.