8

enter image description here

I meet this issue when try to run the js file

Dan Bonachea
  • 2,408
  • 5
  • 16
  • 31
Vodka
  • 89
  • 1
  • 1
  • 3

6 Answers6

15

Simply install the package by entering yarn add --save-dev @nomicfoundation/hardhat-toolbox or npm install --save-dev @nomicfoundation/hardhat-toolbox.

But if you are getting the same error again and again and the package is present in package.json then you might be using npm and yarn parallely, just uninstall either of it and you are good to go.

sebastian
  • 2,386
  • 26
  • 22
Guman Singh
  • 171
  • 2
3

Please provide your 'hardhat.config.js' and 'package.json' file screenshots. To provide the answer, such information is necessary.

In my opinion, you may not have installed all the required packages. Please check if you have the following things in your files:

  1. require("@nomicfoundation/hardhat-toolbox"); make sure you have this in your hardhat.config.js file. If not, replace the first line of the file with the above code.
  2. Also, check if you have @nomicfoundation/hardhat-toolbox this dependency in your package.json file, If not, you may install it using any package manager (npm or yarn) with the command npm i @nomicfoundation/hardhat-toolbox.

This should work, if it doesn't then please provide more information.

Styx
  • 31
  • 1
2

Remove the ethers dependency with yarn remove ethers than you can install and add hardhat again, that worked for me You have to do this because hardhat has it's own ethers module, otherwise the two would get in each other's way

1

npm install --save-dev @nomicfoundation/hardhat-toolbox --force

INSTALL FORCEFULLY

0

I simply installed the package using npm install --save-dev @nomicfoundation/hardhat-toolbox and then tried compiling and it worked for me.

0

For me reinstalling the nomicfoundation/hardhat-toolbox didnt work. I got error

Error HH801: Plugin @nomicfoundation/hardhat-toolbox requires the following dependencies to be installed:

To fix it and deploy my project I had to install all the dependencies using the command

npm install --save-dev @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network-helpers @nomicfoundation/hardhat-chai-matchers @nomiclabs/hardhat-ethers @nomiclabs/hardhat-etherscan chai ethers hardhat-gas-reporter solidity-coverage @typechain/hardhat typechain @typechain/ethers-v5 @ethersproject/abi @ethersproject/providers
code-assassin
  • 415
  • 4
  • 14