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
CodePudding user response:
I am 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
CodePudding user response:
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.