当前位置:   article > 正文

npm使用国内淘宝镜像(最新地址)_npm淘宝镜像最新

npm淘宝镜像最新

前言
我们前端程序员在使用国外的镜像源速度很慢并且容易下载失败,有时候需要尝试多次才有可能下载成功,很麻烦,但是可以切换为国内镜像源,下面我介绍下如何使用淘宝镜像源。

一、命令配置

设置淘宝镜像源 

#最新地址 淘宝 NPM 镜像站喊你切换新域名啦!
npm config set registry https://registry.npmmirror.com
淘宝 NPM 镜像站喊你切换新域名啦! 

注意:原域名https://registry.npm.taobao.org/ 在 2022.06.30 号正式下线和停止 DNS 解析

查看镜像使用状态

npm config get registry

如果返回https://registry.npmmirror.com,说明配置的是淘宝镜像。

那么如何恢复官方镜像源呢?

npm config set registry https://registry.npmjs.org

二、使用cnpm安装

安装cnpm 

 npm install -g cnpm --registry=https://registry.npmmirror.com

# 注册模块镜像

npm set registry https://registry.npmmirror.com  

 // node-gyp 编译依赖的 node 源码镜像  

npm set disturl https://n

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/996657
推荐阅读
相关标签
  

闽ICP备14008679号