nrm切替npmソース

1602 ワード

npmソースは、パケットに依存するサーバアドレスをダウンロードするもので、デフォルトは npm ---- https://registry.npmjs.org/
国内のパートナーは、海外のソース速度が遅すぎることに気づき、国内の淘宝源taobaoを見つけることができます.https://registry.npm.taobao.org/
npmのソースはnano~/.npmrcで修正できますが、手動で修正するのは体力がかかります.コマンドラインでソースを管理できるツールnrmがあります.
グローバルインストールnrm
npm  install   -g   nrm

nrmコマンドの表示
nrm -h

➜  ~ nrm -h   Usage: nrm [options] [command]   Commands:     ls                           List all the registries     current                      Show current registry name     use               Change registry to registry     add [home]  Add one custom registry     del               Delete one custom registry     home [browser]    Open the homepage of registry with optional browser     test [registry]              Show response time for specific or all registries     help                         Print this help   Options:     -h, --help     output usage information     -V, --version  output the version number
私のパソコンのソースは、次のとおりです.
  npm ---- https://registry.npmjs.org/  cnpm --- http://r.cnpmjs.org/* taobao - https://registry.npm.taobao.org/     現在npmで使用されているソースアドレス  nj ----- https://registry.nodejitsu.com/  rednpm - http://registry.mirror.cqupt.edu.cn/  npmMirror  https://skimdb.npmjs.com/registry/  edunpm - http://registry.enpmjs.org/  sinopia  http://100.XX.XX.XX:XXXX/    sinopiaが会社のために自分で作ったnpm倉庫
nrmで最も一般的なコマンドは、次のとおりです. 
1.nrm ls既存のソースを表示 
2.nrm add新規ソース 
3.nrm use既存のソースに切り替える
4.nrm test  そくどを測る