how to solve this err in hardhat vs code

You are using a version of Node.js that is not supported by Hardhat, and it may work incorrectly, or not work at all. Please, make sure you are using a supported version of Node.js. To learn more about which versions of Node.js are supported go to https://hardhat.org/nodejs-versions

An unexpected error occurred:

Error: Cannot find module '@nomiclabs/hardhat-waffle'
Require stack:
- D:\3.1\dppa\hardhat.config.js
- D:\3.1\dppa\node_modules\hardhat\internal\core\config\config-loading.js
- D:\3.1\dppa\node_modules\hardhat\internal\cli\cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at Function.Module._load (node:internal/modules/cjs/loader:780:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\3.1\dppa\hardhat.config.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\3.1\\dppa\\hardhat.config.js',
    'D:\\3.1\\dppa\\node_modules\\hardhat\\internal\\core\\config\\config-loading.js',
    'D:\\3.1\\dppa\\node_modules\\hardhat\\internal\\cli\\cli.js'
  ]
}
PS D:\3.1\dppa>

Upvotes: 0

Views: 1102

Answers (1)

Mime
Mime

Reputation: 1376

It looks like you are trying to run the sample project and are missing plugins.

As stated here, you need to install some plugins for the sample project with the following command.

npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers

Besides that, as stated in the provided link, you should use the latest LTS of Node.js, which is Node.js 16 and can be downloaded here

Upvotes: 2

Related Questions