node环境无法下载zksolc问题

由于node.js环境设置全局代理无效,导致无法下载zksolc。 可通过在hardhat.config.js文件中添加以下代码:

const { ProxyAgent, setGlobalDispatcher } = require("undici")
const proxyAgent = new ProxyAgent("http://127.0.0.1:port")
setGlobalDispatcher(proxyAgent);

其中,port为自己代理的端口

理论上node环境所有无法下载的问题均可通过该方案解决。

请先 登录 后评论
  • 0 关注
  • 0 收藏,786 浏览
  • 提出于 2024-02-06 19:59