将项目从typechain-hardhat更新到@typechain/hardhat包。
编译项目抛出TypeError: glob不是函数错误。我不能运行脚本,测试,编译等。
An unexpected error occurred:
TypeError: glob is not a function
at SimpleTaskDefinition.action (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\@typechain\hardhat\src\index.ts:70:22)
at Environment._runTaskDefinition (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:308:14)
at Environment.run (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:156:14)
at OverriddenTaskDefinition._action (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\@typechain\hardhat\src\index.ts:29:5)
at Environment._runTaskDefinition (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:308:14)
at Environment.run (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:156:14)
at SimpleTaskDefinition.action (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\builtin-tasks\compile.ts:1331:63)
at Environment._runTaskDefinition (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:308:14)
at Environment._runTaskDefinition (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:308:14)
at Environment.run (C:\Users\user\SmartContracts\trade-smart-contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:156:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.发布于 2023-02-06 18:54:18
我已经解决了这个问题:问题是以前的typechain-hardhat包生成了typechain文件夹,但是现在@typechain/hardhat生成了typechain-types文件夹
https://ethereum.stackexchange.com/questions/144396
复制相似问题