换源加速 npm 下载


npm 是 node.js 的包管理工具,由于服务器在国外,下载速度较慢,通过换源至国内镜像源来实现下载的加速。
使用淘宝镜像源
- 临时切换镜像源
1 | npm install <pack name> --registry=https://registry.npmmirror.com |
- 永久切换镜像源
1 | npm config set registry https://registry.npmmirror.com |
- 清除 npm 缓存
1 | npm cache clean --force |