pnpm报错This version of pnpm requires at least Node.js v16.14The current version of Node.js is v16.8.0

ning@MacdeMacBook ~ % pnpm --version
ERROR: This version of pnpm requires at least Node.js v16.14
The current version of Node.js is v16.8.0
Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.

第一步,先查看本机node.js版本:

node -v

第二步,清除node.js的cache:

sudo npm cache clean -f

第三步,安装 n 工具,这是个专门用来管理node.js版本的工具。

sudo npm install -g n

第四步,安装指定版本的node.js

sudo n 16.14.0安装node 16.14.0版本(n后面跟你想要安装的node版本号就可以啦)

sudo n latest安装node最新版本

sudo n stable 安装node稳定版本

sudo n rm xx.xx.xx 删除指定node版本

第五步,再次查看本机的node.js版本:

node -v

第六步,更新npm到最新版,不影响使用可以不更新,非必需

sudo npm install npm@latest -g

pnpm使用:项目初衷 | pnpm

参考:macOS 升级node到指定版本 | CHEGVA

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值