ethereum - 错误 HH12:尝试使用不支持的非本地安装的 Hardhat。请使用 npm 或 Yarn 在本地安装 Hardhat,然后重试
问题描述
我从事安全帽项目已经有一段时间了。
过了一会儿,当我运行
npx hardhat node
启动 HH 服务器时,我收到以下错误:
我尝试研究错误并在安全帽网站上找到了这个
HH12: Hardhat is not installed or installed globally
You tried to run Hardhat from a global installation or not installing it at all. This is not supported.
Please install Hardhat locally using npm or Yarn, and try again.
有趣的是,我创建了一个新的 HH 项目并重新安装了所有内容,
然后将我的代码导入到新项目中,这似乎解决了问题……
但过了一段时间,问题又开始了。
每次发生这种情况时,我都无法继续创建新项目。
我已经被困了好几天了,将不胜感激。
操作系统:windows10
解决方案
尽量不要使用 npx hardhat ...运行安全帽,使用 npm hardhat ...或 yarn hardhat ...在本地运行它,其他可能在 Windows 上导致此错误的东西是 git bash,如果你使用的是 git bash 你在这种情况下将无法运行安全帽尝试在 cmd 中使用 npm 或 yarn 在本地运行它
推荐阅读
- mysql - MySQL:仅当另一列中的值唯一时才设置值
- php - 如何在 Firebird 中将 BLOB SUB_TYPE 0 转换为 TEXT?
- python - 在 pandas groupby DataFrame 中创建异常值列
- spring - Spring Websocket:如何通过任何 convertAndSend 或 convertAndSendToUser 方法拦截 SimpMessagingTemplate 发送的消息?
- xamarin - 使用 msbuild 命令行 xcarchive 到 ipa
- python - 以编程方式运行 Ansible 剧本?
- python - _mapnik 模块名称未找到
- c - 为什么这个 C 代码不起作用?
- memory - 如何使用 Intel Pin 在没有符号信息的可执行文件的用户定义函数中读取或写入内存值?
- apache-spark - 是否可以在 Spark 分区器中使用广播?