node.js的版本,该版本没有由Hardhat提供,但我有LTS版本的节点
我在Ubuntu 20.04安装了NVM。然后使用NVM我安装了节点和NPM。 一般的任务是在我的坚固项目中使用硬汉。 我创建了NPM项目并安装了HardHat:
npm init
npm install --save-dev hardhat
然后我创建了一个简单的硬式项目:npx hardhat
。
但是现在,由于此 npx Hardhat帐户)的任何任务(例如npx Hardhat帐户
)。 nofollow noreferrer“>错误 我使用节点16.14.2,这是一个屏幕 > NVM LS 。
我以为我安装了节点,但不安装node.js(实际上我仍然不完全了解node和node.js之间的区别),所以我使用sudo sudo apt apt nastern nodejs
安装了node.js没有帮助。
因此,我不知道该怎么办,因为我有LTS版本的节点,但是似乎Hardhat可以看到这一点。
另外,我想在remix IDE中使用hardhat插件,但是没有这样的插件
upd 想想,我发现问题。但是我什至没有17.7.2版。 这是我拥有的所有版本。所以现在,我认为,我必须以某种方式对我的节点版本说
I installed nvm in Ubuntu 20.04. Then using nvm I installed node and npm.
The general task is to use hardhat in my Solidity project.
I created npm project and installed hardhat:
npm init
npm install --save-dev hardhat
Then I created a simple hardhat project: npx hardhat
.
But now, I can't use any tasks from hardhat(like npx hardhat accounts
) due to this error
I use the lts version of node 16.14.2, here is a screen from the command nvm ls
.
I thought that I installed node but not node.js(actually I still don't fully understand the difference between node and node.js), so I installed node.js using sudo apt install nodejs
but this does not help.
So, I don't know what to do, because I have LTS version of node, but seems like hardhat can see this.
Also, I wanted to use hardhat plugin in remix IDE but there is no such plugin
UPD: I think, I found the problem. But I even don't have 17.7.2 version. This is the all versions that I have. So now, I think, I have to somehow say to hardhat my node version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
因此,我找到了答案,这真的很愚蠢。我在目录中工作〜/SolidityProjects/testProject。但是在〜/ i有我创建的目录node_module(我不知道何时,我认为我是随机制作的)。因此,该目录以某种方式从〜/solidityprojects/testProject覆盖了node_modules。因此,我将其从〜/中删除,然后开始工作。
So, I found answer, it is really stupid from my side. I working in the directory ~/SolidityProjects/testProject. But in ~/ I have directory node_modules which I created(I don't know when, I think I made it at random). So this directory somehow covered node_modules from ~/SolidityProjects/testProject. So I deleted it from ~/ and it start working.
我在这里遇到了类似的问题。我运行17.9,但刚刚通过运行
NVM安装16.0.0
降级,这似乎已经有效I was getting a similar issue here. I was running 17.9 but just downgraded by running
nvm install 16.0.0
and this seems to have worked使用以下命令:
节点 - version来确保您正在使用预期的nodejs
use following commands:
node --version to ensure you are using expected nodejs