Invalid value undefined for HardhatConfig.networks.goerli.url - Expected a value of type string.

我的交流微博:https://weibo.com/u/2434823180


 

npx hardhat compile 报错

Error HH8: There's one or more errors in your config file:

* Invalid value undefined for HardhatConfig.networks.goerli.url - Expected a value of type string.
* Invalid account: #0 for network: goerli - private key too short, expected 32 bytes

To learn more about Hardhat's configuration, please go to https://hardhat.org/config/

 解决方式

1、添加下面到 hardhat.config 文件

require("dotenv").config() 

 

2、env 文件

key=value

  而不是 key:value

 


 

posted @ 2022-12-02 13:44  apeNote  阅读(348)  评论(0编辑  收藏  举报