zoukankan      html  css  js  c++  java
  • 使用nrm工具高效地管理npm源

    在使用npm时,官方的源下载npm包会比较慢,国内我们基本使用淘宝的源,如果公司内部搭建了一套npm私有仓库,公司内部的源不可能把npm官方的npm包都同步,所以需要切换npm源。如果使用npm/cnpm config set registry xxx来切换源的话,来回切换设置会比较麻烦。使用nrm就可以对源进行高效的管理。使用方法如下:

    全局安装nrm:

    npm install  nrm -g

    常使用的命令包括:ls,use,add,del

    1)nrm  ls。列出已经配置好的所有的源地址。

    nrm ls
    * npm ---- https://registry.npmjs.org/
      cnpm --- http://r.cnpmjs.org/
      taobao - http://registry.npm.taobao.org/

    2)nrm use。切换到指定源上。

    nrm add new https://new.com

    此时,会提示 :

    Registry has been set to: http://r.cnpmjs.org/

    再次执行nrm ls,会得到:

     npm ---- https://registry.npmjs.org/
    *cnpm --- http://r.cnpmjs.org/
     taobao - http://registry.npm.taobao.org/

    3)add。添加一个新的源。

    nrm add new https://new.com

    此时提示:

    add registry new success

    4)del。删除一个已经存在的源

    nrm del new

    此时提示:

    delete registry new success

    其他操作,可以参考

    nrm --help
    Usage: nrm [options] [command]
    
      Commands:
    
        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:
    
        -h, --help     output usage information
        -V, --version  output the version number

    希望大家有更好的工具可以分享。

  • 相关阅读:
    python 线性回归(Linear Regression)预测波士顿房价
    python支持向量机分类MNIST数据集
    python朴素贝叶斯分类MNIST数据集
    感知机(perceptron)
    LMS Algorithm 最小均方算法
    线性回归(Linear Regression)和最小二乘法(ordinary least squares)
    KNN实现mnist、fashion mnist数据集的分类
    JavaScript一些常见的知识点
    用js做一个许愿墙
    js做留言板(可以评论 删除评论 评论时间)
  • 原文地址:https://www.cnblogs.com/happypayne/p/7732780.html
Copyright © 2011-2022 走看看