npm-手册
配置 npmmirror 镜像
- 备份旧镜像
在替换 npmmirror 镜像之前,我们先查看一下原有的镜像
1 | npm get registry |
结果为 https://registry.npmjs.org/
1 | yarn get registry |
结果为 https://registry.yarnpkg.com
- 替换为 npmmirror 镜像
1 | 设置 npm 的源为 npmmirror |
升级版本
查看 npm 版本
1 | npm -v |
升级到最新的 npm 版本
1 | npm install -g npm |
安装指定版本的 npm
1 | npm install -g npm@版本号 |