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

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

文章目录

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. 安装

shell 复制代码
 npm install -g nrm

2. 用法

shell 复制代码
F:\yuanWebStormProjects\yuan-vue>nrm -help
Usage: cli [options] [command]

Options:
  -V, --version                           output the version number
  -h, --help                              output usage information

Commands:
  ls                                      List all the registries
  current [options]                       Show current registry name or URL
  use <registry>                          Change registry to registry
  add <registry> <url> [home]             Add one custom registry
  login [options] <registryName> [value]  Set authorize information for a custom registry with a base64 encoded string or username and pasword
  set-hosted-repo <registry> <value>      Set hosted npm repository for a custom registry to publish packages
  set-scope <scopeName> <value>           Associating a scope with a registry
  del-scope <scopeName>                   Remove a scope
  set [options] <registryName>            Set custom registry attribute
  rename <registryName> <newName>         Set custom registry name
  del <registry>                          Delete one custom registry
  home <registry> [browser]               Open the homepage of registry with optional browser
  publish [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 directly
  test [registry]                         Show response time for specific or all registries
  help                                    Print this help
   if you want to clear the NRM configuration when uninstall you can execute "npm uninstall nrm -g -C or npm uninstall nrm -g --clean"

1. 查看

shell 复制代码
F:\yuanWebStormProjects\yuan-vue>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/

2. 切换

shell 复制代码
F:\yuanWebStormProjects\yuan-vue>nrm use taobao

   Registry has been set to: https://registry.npmmirror.com/

3. 新增

shell 复制代码
add <registry> <url> [home]  
F:\yuanWebStormProjects\yuan-vue>nrm add yuan http://192.168.31.25:8081/repository/yuannode/

    add registry yuan success

4. 删除

shell 复制代码
F:\yuanWebStormProjects\yuan-vue>nrm del yuan

   delete registry yuan success
相关推荐
qiyi.sky8 分钟前
JavaWeb——Vue组件库Element(3/6):常见组件:Dialog对话框、Form表单(介绍、使用、实际效果)
前端·javascript·vue.js
煸橙干儿~~12 分钟前
分析JS Crash(进程崩溃)
java·前端·javascript
安冬的码畜日常21 分钟前
【D3.js in Action 3 精译_027】3.4 让 D3 数据适应屏幕(下)—— D3 分段比例尺的用法
前端·javascript·信息可视化·数据可视化·d3.js·d3比例尺·分段比例尺
l1x1n01 小时前
No.3 笔记 | Web安全基础:Web1.0 - 3.0 发展史
前端·http·html
昨天;明天。今天。1 小时前
案例-任务清单
前端·javascript·css
zqx_72 小时前
随记 前端框架React的初步认识
前端·react.js·前端框架
惜.己3 小时前
javaScript基础(8个案例+代码+效果图)
开发语言·前端·javascript·vscode·css3·html5
什么鬼昵称3 小时前
Pikachu-csrf-CSRF(get)
前端·csrf
长天一色3 小时前
【ECMAScript 从入门到进阶教程】第三部分:高级主题(高级函数与范式,元编程,正则表达式,性能优化)
服务器·开发语言·前端·javascript·性能优化·ecmascript
NiNg_1_2344 小时前
npm、yarn、pnpm之间的区别
前端·npm·node.js