当我安装所有依赖项但没有在打字稿安全帽中获得“typechain”文件夹时。如何获得?
npm 初始化
npm install --save-dev Hardhat
npx 硬达
选择高级示例项目....
npm install --save-dev“hardhat@^2.8.2”“@nomiclabs/hardhat-waffle@^2.0.0”“ethereum-waffle@^3.0.0”“chai@^4.2.0”“ethers@ ^5.0.0" "solhint@^3.3.6" "solidity-coverage@^0.7.16" "@typechain/ethers-v5@^7.0.1" "@typechain/hardhat@^2.3.0" "@typescript -eslint/eslint-plugin@^4.29.1" "@typescript-eslint/parser@^4
使用solidity安全帽时运行
npx hardhat compile
生成typechain文件夹
的“任务”部分所示
删除 typechain 文件夹后我遇到了类似的问题
运行前请务必运行以下命令
npx hardhat compile
:
npx hardhat clean
或者就我而言 yarn hardhat clean
来自文档
警告:第一次运行之前需要做
,否则TypeChain会认为不需要生成任何类型。hardhat clean
https://github.com/dethcrypto/TypeChain/tree/master/packages/hardhat