NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.22k stars 1.38k forks source link

Hardhat local installation #5362

Open kanej opened 3 months ago

kanej commented 3 months ago

Hardhat can be installed as a global cli:

npm install -g hardhat

Invoking hardhat in a project with a local hardhat install should delegate to that version of Hardhat.

hardhat --version
# 3.1.0
cd ./my-hh-project
hardhat --version
# 3.0.0

Running hardhat as if locally without a local installation should error:

> rm -rf ./node_modules
> npx hardhat --version

Error HHxxx: Trying to use a non-local installation of Hardhat, which is not supported.
Please install Hardhat locally using npm or Yarn, and try again.

For more info go to https://hardhat.org/HHxxx or run Hardhat with --show-stack-traces