國內(nèi)npm源鏡像(npm加速下載)
指定npm鏡像
npm 官方原始鏡像網(wǎng)址是:https://registry.npmjs.org/
淘寶 NPM 鏡像:https://registry.npm.taobao.org
阿里云 NPM 鏡像:https://npm.aliyun.com
騰訊云 NPM 鏡像:https://mirrors.cloud.tencent.com/npm/
華為云 NPM 鏡像:https://mirrors.huaweicloud.com/repository/npm/
網(wǎng)易 NPM 鏡像:https://mirrors.163.com/npm/
中科院大學(xué)開源鏡像站:http://mirrors.ustc.edu.cn/
清華大學(xué)開源鏡像站:https://mirrors.tuna.tsinghua.edu.cn/
騰訊,華為,阿里的鏡像站基本上比較全
使用淘寶鏡像源加速 NPM
最新的:
npm config set registry https://registry.npmmirror.com
之前的:
npm config set registry https://registry.npm.taobao.org
使用阿里云 鏡像源加速 NPM
npm config set registry https://npm.aliyun.com
使用騰訊云鏡像源加速 NPM
npm config set registry http://mirrors.cloud.tencent.com/npm/
使用華為云 鏡像源加速 NPM
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
返回npm 官方原始鏡像
npm config set registry https://registry.npmjs.org/
使用那個鏡像,只需要 npm config set registry + 對應(yīng)的鏡像網(wǎng)址就好了
npm config set registry
查看當(dāng)前的鏡像源:npm config get registry
npm config get registry
推薦使用上面的方式指定npm鏡像,當(dāng)然方法不唯一,也可以用 nrm 去指定npm鏡像
什么是nrm
nrm 是一個 npm 源管理器,允許你快速地在 npm 源間切換。文章來源:http://www.zghlxwxcb.cn/news/detail-517790.html
安裝nrm
npm install -g nrm
使用
查看可選的源
nrm ls
切換
如果要切換到taobao源,執(zhí)行命令文章來源地址http://www.zghlxwxcb.cn/news/detail-517790.html
nrm use taobao
測試速度
nrm test
到了這里,關(guān)于國內(nèi)npm源鏡像(npm加速下載) 指定npm鏡像的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!