1.切換到淘寶鏡像
加快npm包的下載速度,
//已失效
//npm config set registry https://registry.npm.taobao.org/
npm config set registry https://registry.npmmirror.com
這會將npm的注冊表設(shè)置為淘寶鏡像
查看:
npm config get registry
如果返回的結(jié)果是 https://registry.npmmirror.com,則表示切換淘寶鏡像成功。
2.切換回官方npm注冊表
切換鏡像可能會有一些副作用,比如某些包可能在淘寶鏡像上不存在或更新較慢,這時可隨時切換回官方npm注冊表
npm config set registry https://registry.npmjs.org/
查看:
npm config get registry
如果返回的結(jié)果是http://registry.npmjs.org/ ,則表示切換成官方npm注冊表成功。文章來源:http://www.zghlxwxcb.cn/news/detail-820347.html
參考:https://blog.csdn.net/qq_27487739/article/details/135247556文章來源地址http://www.zghlxwxcb.cn/news/detail-820347.html
到了這里,關(guān)于npm官方注冊表和淘寶鏡像切換的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!