网站首页 > 技术文章 正文
npm 如何管理和切换镜像
方法一:
查看当前镜像源
> # npm get registry
https://registry.npmjs.org/
切换为淘宝镜像
> # npm config set registry https://registry.npm.taobao.org
切换回原镜像
> # npm config set registry https://registry.npmjs.org
使用 npmmirror 镜像
> # npm config set registry https://registry.npmmirror.com
> # npm config list
......
registry = "https://registry.npmmirror.com/"
......
或者
> # npm install -g cnpm --registry=https://registry.npmmirror.com
注意: 原淘宝 npm 域名即将停止解析(https://registry.npm.taobao.org), 启用新的镜像(https://registry.npmmirror.com)
参考资料:
https://npmmirror.com/
方法二:
安装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
> # npm config list
......
registry = "https://registry.npmmirror.com/"
......
猜你喜欢
- 2024-12-30 go-admin开源项目,快速搭建一个管理后台系统,直接二次开发上线
- 2024-12-30 Ollama教程:本地LLM管理、WebUI对话、Python/Java客户端API应用
- 2024-12-30 Go 项目推荐之 go-admin go的项目
- 2024-12-30 nodejs多版本管理工具 nodejs 版本
- 2024-12-30 npm提示 sill idealTree buildDeps(安装element-ui组件库)
- 2024-12-30 CentOS+Nexus搭建npm私有仓库并推送代码
- 2024-12-30 内网npm私有仓库搭建以及使用教程
- 2024-12-30 TS,TypeScript,Windows环境下构建环境,安装、编译且运行
- 2024-12-30 如何提高npm 下载依赖过慢的问题 npm下载包
- 2024-12-30 使用 Verdaccio 搭建npm私有仓库 搭建自己的npm
- 最近发表
- 标签列表
-
- cmd/c (90)
- c++中::是什么意思 (84)
- 标签用于 (71)
- 主键只能有一个吗 (77)
- c#console.writeline不显示 (95)
- pythoncase语句 (88)
- es6includes (74)
- sqlset (76)
- apt-getinstall-y (100)
- node_modules怎么生成 (87)
- chromepost (71)
- flexdirection (73)
- c++int转char (80)
- mysqlany_value (79)
- static函数和普通函数 (84)
- el-date-picker开始日期早于结束日期 (76)
- js判断是否是json字符串 (75)
- asynccallback (71)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- java (73)
- js数组插入 (83)
- mac安装java (72)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)