Home > database >  Tried to compile contract using hardhat but got error:- Error: The specified module could not be fou
Tried to compile contract using hardhat but got error:- Error: The specified module could not be fou

Time:09-14

Error: The specified module could not be found.
\\?\C:\Users\Lenovo\Desktop\Hardhat\node_modules\@nomicfoundation\solidity-analyzer-win32-x64-msvc\solidity-analyzer.win32-x64-msvc.node      
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1210:18)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\Lenovo\Desktop\Hardhat\node_modules\@nomicfoundation\solidity-analyzer\index.js:69:29)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Tried to compile but didnt get any result.It countain the specified modules but throws error.

CodePudding user response:

Drag that specified module into that folder where all the other files are kept. Do the same with other modules till all the files required for the project are not under one folder. This might help. Thank You.

CodePudding user response:

Here's a workaround to fix the module_not_found compiling issue. https://github.com/NomicFoundation/hardhat/issues/3176

  • Related