nvm 版本 1.1.10
node 版本 16.14.2
npm 版本 8.5.0
1. node 为 16.13.2 以上通过 nvm install 版本号方式安装会出现这个报错,那我们手动下载就能解决这个问题
2. 当前机器上的 nvm 已安装的 node 列表
>>> npm install pnpm -g
npm ERR! Unexpected token '.'
npm ERR! A complete log of this run can be found in:
>>> nvm ls
18.16.1
18.13.0
16.17.0
* 16.14.2 (Currently using 64-bit executable)
16.13.2
14.19.1
14.16.1
14.15.1
14.13.0
12.16.1
3. v16.14.2 出现这个报错,我们以这个为例
4. 先切换任意版本 nvm use 16.17.0,查看版本是否切换成功 nvm ls
>>> nvm use 16.17.0
Now using node v16.17.0 (64-bit)
>>> nvm ls
18.16.1
18.13.0
* 16.17.0 (Currently using 64-bit executable)
16.14.2
16.13.2
14.19.1
14.16.1
14.15.1
14.13.0
12.16.1
5. 成功切换后打开淘宝镜像(末尾为要下载的版本号)
registry.npmmirror.com/binary.html…
下载对应系统的 node 压缩包(图片为 windows 64位 下载的包)
6. nvm root 查看 nvm 安装目录
>>> nvm root
Current Root: D:\software\nvm