copying : node/20.12.2
installed : v20.12.2 to /usr/local/bin/node
active : v16.14.2 at /root/.nvm/versions/node/v16.14.2/bin/node
我无法在 wsl vs code 中使用 Node v20.12.2,但我可以在正常的 vs code 中使用它
如果我尝试激活节点 20.12.2,纱线就会出错
root@:/hh-fcc/hardhat-simple-storage-fcc# yarn -v
ERROR: There are no scenarios; must have at least one.
root@:/hh-fcc/hardhat-simple-storage-fcc# yarn hardhat compile
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'hardhat'
尝试这些步骤,
nvm use 20.12.2
yarn add hardhat
验证 Node.js 和 Yarn 版本:
node -v
yarn -v