javascript - HardHat Unable to download compiler versions list - Stack Overflow

So this is my first interaction with hardhat. I created a sample project using npx hardhat but for some

So this is my first interaction with hardhat. I created a sample project using npx hardhat but for some reason, when I try to Run:

npx hardhat test

I get the following error:

Error HH502: Couldn't download piler versions list. Please check your connection.

With the following error in the stack trace:

Caused by: FetchError: request to .json failed, reason: getaddrinfo EAI_AGAIN binaries.soliditylang

So I tried navigating to binaries.soliditylang with Chrome and I found out that I'm getting net::ERR_NAME_NOT_RESOLVED.

(I get this error even when I try to navigate to docs.soliditylang)

I understand it has something to do with DNS but I don't have a clue how to solve it.

So this is my first interaction with hardhat. I created a sample project using npx hardhat but for some reason, when I try to Run:

npx hardhat test

I get the following error:

Error HH502: Couldn't download piler versions list. Please check your connection.

With the following error in the stack trace:

Caused by: FetchError: request to https://binaries.soliditylang/windows-amd64/list.json failed, reason: getaddrinfo EAI_AGAIN binaries.soliditylang

So I tried navigating to binaries.soliditylang with Chrome and I found out that I'm getting net::ERR_NAME_NOT_RESOLVED.

(I get this error even when I try to navigate to docs.soliditylang)

I understand it has something to do with DNS but I don't have a clue how to solve it.

Share Improve this question asked Jan 5, 2022 at 12:31 Daniel SegalDaniel Segal 311 silver badge3 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

I faced similar issue. However, for me hardhat is not able to download list of piler versions behind corporate proxy. Tried a lot of things. No luck. After a lot of trial and errors, found a way to make this work. Download list.json and keep it locally at C:\Users\<your-user>\AppData\Local\hardhat-nodejs\Cache\pilers\windows-amd64 (windows). Also, download the solidity piler executable for windows (required version) from https://github./ethereum/solidity/releases and place it in the same folder mentioned above. Now, peruse your list.json and identify the object for the solc piler version of interest. Rename the executable as with the long name given in path in that object. For e.g., if you need solc version 0.8.0, the path in list.json for 0.8.0 version is solc-windows-amd64-v0.8.4+mit.c7e474f2.exe. Use this to rename the downloaded executable. Now, run npm test. This should fix the issue.

There is also an interesting way to run the piler within docker on windows. For this, follow the discussion here - https://github./NomicFoundation/hardhat/issues/1280

Adding an .env file to the root of the project with

HTTPS_PROXY = ...

Solved in https://github./NomicFoundation/hardhat/pull/1291

Had to sudo chmod -R 777 /Users/<username>/Library/Caches/hardhat-nodejs first.

Changing owner of hardhat cache directory worked for me.

sudo chown -R $USER /Users/$USER/Library/Caches/hardhat-nodejs

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745189406a4615791.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信