网站首页 > 博客文章 正文
关键字:npm、nrm、yarn、yrm
混迹IT多年的资深后端开发者及项目管理者,欢迎学术沟通,其他合作
目录
npm镜像源
1、查看当前使用的镜像源
2、修改镜像源
yarn镜像源
1、查看当前使用的镜像源
2、修改镜像源
npm镜像源
因为 npm 默认的源是在国外,我们访问时会比较慢,一般都会使用淘宝的镜像,或者有些有公司自己的镜像,这就涉及到切换源的操作,总结一下这些操作。
1、查看当前使用的镜像源
npm config get registry
2、修改镜像源
方式1:npm命令修改
npm config set registry https://registry.npmmirror.com/
方式2: 第三方工具nrm管理镜像源(推荐)
nrm可以帮助你轻松地添加、删除、查询、切换所有的Yarn Registries
安装 nrm:
npm install -g nrm
列出所有镜像源:
nrm ls
npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
* taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/
切换镜像:
nrm use taobao
SUCCESS The registry has been changed to 'taobao'.
新增镜像:
nrm add aliyun http://maven.aliyun.com/nexus/content/groups/public
删除镜像:
nrm del taobao
测试延迟(访问速度):
yrm test aliyun
查看帮助:
$ nrm -h
Usage: cli [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
ls List all the registries
current [options] Show current registry name or URL
use <name> Change current registry
add <name> <url> [home] Add custom registry
login [options] <name> [base64] Set authorize information for a custom registry with a base64 encoded string or username
and password
set-hosted-repo <name> <repo> Set hosted npm repository for a custom registry to publish package
set-scope <scopeName> <url> Associating a scope with a registry
del-scope <scopeName> Remove a scope
set [options] <name> Set a custom registry attribute
rename <name> <newName> Change custom registry name
del <name> Delete custom registry
home <name> [browser] Open the homepage of registry with optional browser
test [registry] Show response time for specific or all registries
help [command] display help for command
yarn镜像源
执行命令时,yarn 默认是去 npm/yarn 官方镜像源(国外)获取资源,所以速度较慢甚至不可用,解决该问题需要修改默认配置为国内镜像。
1、查看当前使用的镜像源
yarn config get registry
2、修改镜像源
方式1:yarn命令修改
yarn config set registry https://registry.npm.taobao.org/
方式2: 第三方工具yrm管理镜像源(推荐)
yrm可以帮助你轻松地添加、删除、查询、切换所有的Yarn Registries
安装 yrm:
npm install -g yrm
列出所有镜像源:
yrm ls
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
rednpm - http://registry.mirror.cqupt.edu.cn/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
yarn --- https://registry.yarnpkg.com
aliyun - http://maven.aliyun.com/nexus/content/groups/public/
切换镜像:
yrm use taobao
YARN Registry has been set to: https://registry.npm.taobao.org/
NPM Registry has been set to: https://registry.npm.taobao.org/
新增镜像:
yrm add aliyun http://maven.aliyun.com/nexus/content/groups/public
删除镜像:
yrm del taobao
测试延迟(访问速度):
yrm test aliyun
查看帮助:
yrm -h
Usage: cli [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
ls List all the registries
current Show current registry name
use <registry> Change registry to registry
add <registry> <url> [home] Add one custom registry
del <registry> Delete one custom registry
home <registry> [browser] Open the homepage of registry with optional browser
test [registry] Show response time for specific or all registries
help Print
猜你喜欢
- 2024-11-11 一个基于SpringBoot2的商城系统,拿去接私活是真的香(附源码)
- 2024-11-11 用jenkins构建部署前端vue系统,linux-x64-83_binding.node
- 2024-11-11 vue3源码学习--调试环境搭建(vue3调试工具)
- 2024-11-11 新电脑之-sourcetree&ssh &vscode&npm拉取远程vue代码并运行
- 2024-11-11 Hexo历险记之二多系统安装Node(hexo官网主题)
- 2024-11-11 智能合约_安装Web3J环境(智能合约图解)
- 2024-11-11 nvm报错解决:配置最新淘宝镜像源(nvm 淘宝镜像)
- 2024-11-11 NodejJS包管理工具(nodejs jar)
- 2024-11-11 小程序开发——Taro框架从入门到放弃
- 2024-11-11 集成并部署开源若依后台系统(微服务版)到腾讯云
你 发表评论:
欢迎- 08-06nginx 反向代理
- 08-06跨表插入连续的日期,sheetsname函数#excel技巧
- 08-06初中生也能学的编程,不走弯路,先用后学
- 08-06find命令的“七种武器”:远不止-name和-type
- 08-06恶意代码常见的编程方式
- 08-06kali2021ping 外网不通
- 08-06因为一个函数strtok踩坑,我被老工程师无情嘲笑了
- 08-06hadoop集群搭建详细方法
- 52℃nginx 反向代理
- 最近发表
- 标签列表
-
- ifneq (61)
- 字符串长度在线 (61)
- googlecloud (64)
- powershellfor (73)
- messagesource (71)
- plsql64位 (73)
- vueproxytable (64)
- npminstallsave (63)
- #NAME? (61)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- nacos启动失败 (64)
- ssh-add (70)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- qcombobox样式表 (68)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)