在使用npm時,官方的源下載npm包會比較慢,國內咱們基本使用淘寶的源,最近公司內部搭建了一套npm私有倉庫。要添加本身公司內部的npm源,公司內部的源不可能把npm官方的npm包都全量同步,故須要npm源之間的切換,若是使用npm registry xxx的話,太很差管理了。nrm是管理npm源切換的利器。使用方法以下: 安裝nrmnode
npm install -g nrm nrm --helpnpm
Usage: nrm [options] [command]測試
Commands:this
ls list all the registries current show current registry name use <registry> change registry to registry add <registry> <url> [home] add one custom registry del|rm <registry> delete one custom registry home <registry> [browser] open the homepage of registry with optional browser test [registry] show response time for specific or all registries help print this help
Options:url
-h, --help output usage information -V, --version output the version number
主要使用ls和use命令 1)nrm ls是列出來如今已經配置好的全部的原地址code
nrm ls npm ---- https://registry.npmjs.org/orm
nrm use npm 3)nrm add添加源 4)nrm del刪除源 5)nrm test測試源的響應時間,能夠做爲使用哪一個源的參考ci
做者:realjade 連接:http://www.jianshu.com/p/5dd18d246281 來源:簡書 著做權歸做者全部。商業轉載請聯繫做者得到受權,非商業轉載請註明出處。jade