npm设置和查看仓库源

2019-04-083374次阅读npm

在使用npm命令时,如果直接从国外的仓库下载依赖包,下载速度会很慢且有时还下载不下来,这时候可以切换npm的仓库源试试。

//临时使用从淘宝仓库源下载
npm --registry=https://registry.npm.taobao.org install
//设置淘宝源
npm config set registry https://registry.npm.taobao.org
//设置回默认源
npm config set registry https://registry.npmjs.org
//查看源
npm config get registry

或者编辑 ~/.npmrc配置文件

registry = https://registry.npm.taobao.org

 

上一篇: 浏览器兼容的copy复制功能  下一篇: gulp运行报错:Task function must be specified必须指定任务函数  

npm设置和查看仓库源相关文章