Node.js:使用nrm来管理npm源

简介: Node.js:使用nrm来管理npm源

npm切换源

# 设置源
$ npm set registry https://registry.npm.taobao.org/
# 查看npm源
$ npm config ls

使用nrm管理npm源

安装

$ npm install -g nrm

查看帮助

$ nrm -h
Usage: nrm [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"

使用


# 查看源列表
$ 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 cnpm
Registry has been set to: https://r.cnpmjs.org/
相关文章
|
13天前
|
网络安全 计算机视觉
【node】 npm install 报错:code 128
【node】 npm install 报错:code 128
33 1
|
2月前
|
资源调度 JavaScript
nodeJS 的 npm 设置国内高速镜像之淘宝镜像的方法
nodeJS 的 npm 设置国内高速镜像之淘宝镜像的方法
1603 2
|
1月前
|
JavaScript 内存技术
node与npm版本对应关系以及使用nvm管理node版本
node与npm版本对应关系以及使用nvm管理node版本
169 0
|
27天前
|
Linux 开发工具 git
node使用nrm 管理托管node的安装源
node使用nrm 管理托管node的安装源
41 1
|
1月前
|
内存技术
node版本与npm版本不对应的解决方案
node版本与npm版本不对应的解决方案
25 0
|
1月前
|
Web App开发 JavaScript 前端开发
如何使用npm创建Node.js项目?
【2月更文挑战第10天】
51 3
如何使用npm创建Node.js项目?
|
2月前
|
JavaScript 前端开发
Npm 命令大全介绍(NodeJs)
Npm 命令大全介绍(NodeJs)
35 0
|
4月前
|
Ubuntu
node、npm 命令升级
node、npm 命令升级
|
3月前
|
JavaScript
node.js 项目中执行 npm install 命令后看到的 idealTree inflate 的含义
node.js 项目中执行 npm install 命令后看到的 idealTree inflate 的含义
173 0
|
7月前
npm install 报错 npm ERR! puppeteer@1.20.0 install: `node install.js`
npm install 报错 npm ERR! puppeteer@1.20.0 install: `node install.js`
187 0

推荐镜像

更多