无法在 WSL 上更新 Node.js

问题描述 投票:0回答:1
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'
node.js windows-subsystem-for-linux yarnpkg hardhat
1个回答
0
投票

尝试这些步骤,

nvm use 20.12.2


yarn add hardhat

验证 Node.js 和 Yarn 版本:

node -v
yarn -v
© www.soinside.com 2019 - 2024. All rights reserved.