一、修改成騰訊云鏡像源
1、命令
npm config set registry http://mirrors.cloud.tencent.com/npm/
- 驗(yàn)證命令
npm config get registry
如果返回http://mirrors.cloud.tencent.com/npm/,說明鏡像配置成功。
二、修改成淘寶鏡像源
- 命令
npm config set registry https://registry.npmmirror.com
- 驗(yàn)證命令
npm config get registry
如果返回https://registry.npmmirror.com,說明鏡像配置成功。
三、修改成華為云鏡像源
- 命令
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
- 驗(yàn)證命令
npm config get registry
如果返回https://mirrors.huaweicloud.com/repository/npm/,說明鏡像配置成功。
四、通過使用淘寶定制的cnpm安裝
- 安裝cnpm
npm install -g cnpm --registry=https://registry.npmmirror.com
- 使用cnpm
cnpm install xxx文章來源:http://www.zghlxwxcb.cn/news/detail-588234.html
參考
https://cloud.tencent.com/developer/article/1372949文章來源地址http://www.zghlxwxcb.cn/news/detail-588234.html
到了這里,關(guān)于npm 加速 國內(nèi)鏡像源的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!