Can't install packages for Hardhat project

Viewed 2271

I wanted to create a project using Hardhat environment. I've tried following https://hardhat.org/getting-started/ tutorial from their side. In there, we have a TIP to install all required packages. Unfortunately when I run npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers first I can see a lot of warnings about deprecated packages and then

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/ethereumjs/ethereumjs-abi.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\(path)

I've tried installing ethereum-waffle with specific version selected etc. it always ends with the same error.

Do you know how to overcome it? Why so many packages are deprecated during install? Is this getting-started outdated and I should start hardhat project in some other way?

1 Answers

When you run npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers , you are installing both. The @nomicfoundation/hardhat-chai-matchers plugin is meant to be a drop-in replacement for the @nomiclabs/hardhat-waffle plugin. So having just one is okay. I recommend you to migrate and use the Hardhat Chai Matchers plugin. Use this link for more information. => "https://hardhat.org/hardhat-chai-matchers/docs/migrate-from-waffle". I hope this helps out a little bit.

Related