Could not find a compiler version matching 0.4.25

Could not find a compiler version matching 0.4.25. Please ensure you are specifying a valid version

这个问题没把我气死,特此记录一下。附:很多人说在truffle-config.js添加固定solc版本,我这边怎么都没有效果

我的环境:

Could not find a compiler version matching 0.4.25

问题:

Could not find a compiler version matching 0.4.25

解决步骤:truffle降低版本号就好啦开心

  1. 首先,卸载您当前的truffle,命令:npm uninstall -g truffle
  2. 安装指定版本truffle,我本来默认安装的是5.1.45,现在安装5.0的,命令:npm install -g [email protected]
  3. 当前环境Could not find a compiler version matching 0.4.25
  4. 测试下好了没,编译命令:truffle compileCould not find a compiler version matching 0.4.25

以上效果就是好啦