简体   繁体   中英

cannot get hardhat to compile or run

i've been wrecking my brain to get hardhat to work on my machine. After some hacky endeavors i managed to upgrade my npm to 8.7.0 and my nodejs to 16.14.2 eventho i am using windows 7. Which is not ideal to start with, but i really don't want to upgrade to win10 unless there's no other way to compile/deploy.

I'm using VSC's terminal putting "npx hardhat compile". and i get the following compilation error:

Internal exception in StandardCompiler::compile: C:\Users\circleci\project\libsolidity\ast\AST.cpp(183): Throw in function class std::vector<class solidity::frontend::ErrorDefinition const *,class std::allocator<class solidity::frontend::ErrorDefinition const *> > __cdecl solidity::frontend::ContractDefinition::interfaceErrors(bool) const
Dynamic exception type: struct boost::wrapexcept<struct solidity::langutil::InternalCompilerError>
std::exception::what: 
[struct solidity::util::tag_comment * __ptr64] = 

An unexpected error occurred:

Error: Command failed: C:\Users\Rnsn\AppData\Local\hardhat-nodejs\Cache\compilers\windows-amd64\solc-windows-amd64-v0.8.4+commit.c7e474f2.exe --standard-json

    at ChildProcess.exithandler (node:child_process:399:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
  killed: false,
  code: 3221225477,
  signal: null,
  cmd: 'C:\\Users\\Rnsn\\AppData\\Local\\hardhat-nodejs\\Cache\\compilers\\windows-amd64\\solc-windows-amd64-v0.8.4+commit.c7e474f2.exe --standard-json'
}

The solc (solidity compiler) is not compatible with your OS, it's not about hardhat. I highly recommend you to upgrade your OS to MacOS/Linux if you want to work on smart contracts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM