I am trying to create a new Hardhat project. Hardhat gives me some pre-created sol files and some scripts. I am just trying to compile this pre-created project, but an error occurred.
\\?\C:\Users\myuser\Desktop\SolidityProjects\emptyhardhatfinal\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 require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\myuser\Desktop\SolidityProjects\emptyhardhatfinal\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'
}
npm init -y
npm i --dev hardhat
npx hardhat
and create a JavaScript projectnpm i --dev @nomicfoundation/hardhat-toolbox
`npx hardhat compile``` the error above occurred.
My Node.js version is v16.17.0.
User variables for my.user = C:\Users\myuser\AppData\Roaming\npm
System variables = C:\Program Files\nodejs\
I realized that the "AppData\Roaming\npm" folder is empty. But inside another PC that this project worked well is not empty; there is a "node_modules" folder.
What is the problem and how can I solve this?