• npm镜像源管理


    常见npm命令,大家共勉。
    1、查看npm源地址
    npm config list

    结果:
    metrics-registry = "http://registry.npm.taobao.org/"

    2、修改registry地址,比如修改为淘宝镜像源。
    npm set registry https://registry.npm.taobao.org/
    如果有一天你肉身FQ到国外,用不上了,用rm命令删掉它
    npm config rm registry

    3、nrm是专门用来管理和快速切换私人配置的registry
    建议全局安装
    npm install nrm -g --save
    用nrm ls命令查看默认配置,带*号即为当前使用的配置
    nrm ls

     npm ---- https://registry.npmjs.org/
      cnpm --- http://r.cnpmjs.org/
    * taobao - https://registry.npm.taobao.org/
      nj ----- https://registry.nodejitsu.com/
      rednpm - http://registry.mirror.cqupt.edu.cn/
      npmMirror  https://skimdb.npmjs.com/registry/
      edunpm - http://registry.enpmjs.org/
    

    也可以直接输入以下命令查看当前使用的是哪个源
    nrm current
    切换源
    nrm use cnpm
    用nrm add 命令添加公司私有npm源,如http://registry.npm.360.org(随便写的),起个别名叫qihoo
    nrm add qihoo http://registry.npm.360.org

    测试下速度
    nrm test npm
    输出npm ---- 790ms

    最后,如果你被公司开除了,怒删公司npm源配置
    nrm del qihoo


    参考: https://www.cnblogs.com/wangmeijian/p/7072053.html

  • 相关阅读:
    WordCount
    vs2013安装及测试
    阅读程序,回答问题
    补作业:随机生成二元四则运算
    第一次合作
    漫漫“码农”路
    我的进度条
    Believe
    软件工程个人总结
    结队作业——电梯调度程序
  • 原文地址:https://www.cnblogs.com/wangxiaoduan/p/10794592.html
Copyright © 2020-2023  润新知