PS D:\web 3.0\smart_contract> npx hardhat run scripts/deploy.js --network ropsten
Error: Cannot find module '../../builtin-tasks/task-names'
Require stack:
- D:\web 3.0\smart_contract\node_modules\hardhat\internal\cli\cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (D:\web 3.0\smart_contract\node_modules\hardhat\src\internal\cli\cli.ts:7:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
我也有这个bug;我在我拥有的
hardhat
教程存储库中拥有它。
对我来说,问题来自于一个
yarn.lock
文件,当yarn指定从github安装包时,该文件没有指定提交哈希。
我吹走了(
rm
'd)我的yarn.lock
文件(在根目录和./hardhat
中)并重新安装,它起作用了。