nrm之npm镜像源管理工具(NPMRegistryManager)

2024-03-04 21:20

本文主要是介绍nrm之npm镜像源管理工具(NPMRegistryManager),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

nrm之npm镜像源管理工具(NPMRegistryManager)

文章目录

  • nrm之npm镜像源管理工具(NPMRegistryManager)
  • 1. Whats is nrm?
    • 1. 官网地址
    • 2. 关于nrm
    • How to configure yarn to use private registry ?
    • 如何配置yarn使用私有注册表?
  • 2. 安装
  • 2. 用法
    • 1. 查看
    • 2. 切换
    • 3. 新增
    • 4. 删除

1. Whats is nrm?

1. 官网地址

https://github.com/Pana/nrm

https://www.npmjs.com/package/nrm

2. 关于nrm

nrm can help you easy and fast switch between different npm registries, now include: npm, cnpm, taobao, nj(nodejitsu).

nrm可以帮助您在不同的 npm 注册表之间轻松快速地切换,现在包括:npm, cnpm, taobao, nj(nodejitsu).

nrm(NPM registry manager) 是npm的镜像源管理工具,有时候国外资源太慢,使用这个就可以快速地在 npm 源间切换

How to configure yarn to use private registry ?

just add .yarnrc in your project’s directory and write there: registry “http://your.registry”

Or you can configure it in your HOME directory’s .yarnrc

如何配置yarn使用私有注册表?

只需在项目目录中添加 .yarnrc 并在其中写入: registry “http://your.registry”

或者您可以在 HOME 目录的 .yarnrc 中配置它

2. 安装

 npm install -g nrm

2. 用法

F:\yuanWebStormProjects\yuan-vue>nrm -help
Usage: cli [options] [command]Options:-V, --version                           output the version number-h, --help                              output usage informationCommands:ls                                      List all the registriescurrent [options]                       Show current registry name or URLuse <registry>                          Change registry to registryadd <registry> <url> [home]             Add one custom registrylogin [options] <registryName> [value]  Set authorize information for a custom registry with a base64 encoded string or username and paswordset-hosted-repo <registry> <value>      Set hosted npm repository for a custom registry to publish packagesset-scope <scopeName> <value>           Associating a scope with a registrydel-scope <scopeName>                   Remove a scopeset [options] <registryName>            Set custom registry attributerename <registryName> <newName>         Set custom registry namedel <registry>                          Delete one custom registryhome <registry> [browser]               Open the homepage of registry with optional browserpublish [options] [<tarball>|<folder>]  Publish package to current registry if current registry is a custom registry.if you're not using custom registry, this command will run npm publish directlytest [registry]                         Show response time for specific or all registrieshelp                                    Print this helpif you want to clear the NRM configuration when uninstall you can execute "npm uninstall nrm -g -C or npm uninstall nrm -g --clean"

1. 查看

F:\yuanWebStormProjects\yuan-vue>nrm lsnpm ---------- 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/

2. 切换

F:\yuanWebStormProjects\yuan-vue>nrm use taobaoRegistry has been set to: https://registry.npmmirror.com/

3. 新增

add <registry> <url> [home]  
F:\yuanWebStormProjects\yuan-vue>nrm add yuan http://192.168.31.25:8081/repository/yuannode/add registry yuan success

4. 删除

F:\yuanWebStormProjects\yuan-vue>nrm del yuandelete registry yuan success

这篇关于nrm之npm镜像源管理工具(NPMRegistryManager)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/774481

相关文章

Python包管理工具pip的升级指南

《Python包管理工具pip的升级指南》本文全面探讨Python包管理工具pip的升级策略,从基础升级方法到高级技巧,涵盖不同操作系统环境下的最佳实践,我们将深入分析pip的工作原理,介绍多种升级方... 目录1. 背景介绍1.1 目的和范围1.2 预期读者1.3 文档结构概述1.4 术语表1.4.1 核

java实现docker镜像上传到harbor仓库的方式

《java实现docker镜像上传到harbor仓库的方式》:本文主要介绍java实现docker镜像上传到harbor仓库的方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录1. 前 言2. 编写工具类2.1 引入依赖包2.2 使用当前服务器的docker环境推送镜像2.2

springboot项目打jar制作成镜像并指定配置文件位置方式

《springboot项目打jar制作成镜像并指定配置文件位置方式》:本文主要介绍springboot项目打jar制作成镜像并指定配置文件位置方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录一、上传jar到服务器二、编写dockerfile三、新建对应配置文件所存放的数据卷目录四、将配置文

python常见环境管理工具超全解析

《python常见环境管理工具超全解析》在Python开发中,管理多个项目及其依赖项通常是一个挑战,下面:本文主要介绍python常见环境管理工具的相关资料,文中通过代码介绍的非常详细,需要的朋友... 目录1. conda2. pip3. uvuv 工具自动创建和管理环境的特点4. setup.py5.

Python包管理工具核心指令uvx举例详细解析

《Python包管理工具核心指令uvx举例详细解析》:本文主要介绍Python包管理工具核心指令uvx的相关资料,uvx是uv工具链中用于临时运行Python命令行工具的高效执行器,依托Rust实... 目录一、uvx 的定位与核心功能二、uvx 的典型应用场景三、uvx 与传统工具对比四、uvx 的技术实

Docker安装MySQL镜像的详细步骤(适合新手小白)

《Docker安装MySQL镜像的详细步骤(适合新手小白)》本文详细介绍了如何在Ubuntu环境下使用Docker安装MySQL5.7版本,包括从官网拉取镜像、配置MySQL容器、设置权限及内网部署,... 目录前言安装1.访问docker镜像仓库官网2.找到对应的版本,复制右侧的命令即可3.查看镜像4.启

Python+Tkinter实现Windows Hosts文件编辑管理工具

《Python+Tkinter实现WindowsHosts文件编辑管理工具》在日常开发和网络调试或科学上网场景中,Hosts文件修改是每个开发者都绕不开的必修课,本文将完整解析一个基于Python... 目录一、前言:为什么我们需要专业的Hosts管理工具二、工具核心功能全景图2.1 基础功能模块2.2 进

Gradle在国内配置镜像加速的实现步骤

《Gradle在国内配置镜像加速的实现步骤》在国内使用Gradle构建项目时,最大的痛点就是依赖下载贼慢,甚至卡死,下面教你如何配置国内镜像加速Gradle下载依赖,主要是通过改写repositori... 目录引言一、修改 build.gradle 或 settings.gradle 的 reposito

Git可视化管理工具(SourceTree)使用操作大全经典

《Git可视化管理工具(SourceTree)使用操作大全经典》本文详细介绍了SourceTree作为Git可视化管理工具的常用操作,包括连接远程仓库、添加SSH密钥、克隆仓库、设置默认项目目录、代码... 目录前言:连接Gitee or github,获取代码:在SourceTree中添加SSH密钥:Cl

Android Studio 配置国内镜像源的实现步骤

《AndroidStudio配置国内镜像源的实现步骤》本文主要介绍了AndroidStudio配置国内镜像源的实现步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,... 目录一、修改 hosts,解决 SDK 下载失败的问题二、修改 gradle 地址,解决 gradle