本文主要是介绍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)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!