zoukankan      html  css  js  c++  java
  • 设置npm源的几种方式

    设置npm源的几种方式

    原始源

    # the original source
    https://registry.npmjs.org/
    

    方案: 使用nrm

    • 安装
    npm install -g nrm
    
    • 列出源的候选项
    nrm ls
    

    输出结果:

    * npm -------- https://registry.npmjs.org/
      yarn ------- https://registry.yarnpkg.com/
      cnpm ------- http://r.cnpmjs.org/
      taobao ----- https://registry.npm.taobao.org/
      nj --------- https://registry.nodejitsu.com/
      npmMirror -- https://skimdb.npmjs.com/registry/
      edunpm ----- http://registry.enpmjs.org/
    
    • 使用淘宝源
    nrm use taobao
    

    方案: 改变全局的注册

    • 设置成淘宝源
    npm config set registry https://registry.npm.taobao.org
    
    • 查看结果
    npm config get registry
    

    输出结果:

    https://registry.npm.taobao.org/
    
    • 测试一下
    npm info underscore
    

    方案: 在命令行里指定源

    npm --registry https://registry.npm.taobao.org install [name]
    

    方案: 修改 ~/.npmrc

    registry = https://registry.npm.taobao.org
    

    方案: 使用cnpm

    npm install -g cnpm --registry=https://registry.npm.taobao.org
    cnpm install [name]
    

    参照

    淘宝源链接

  • 相关阅读:
    webServer xampp的安装及使用
    javascript 原生方法监听DOM结构改变事件
    c# 文件简繁体转换
    c# 网络是否连接
    JMS
    JMS
    JMS
    Quartz Scheduler(2.2.1)
    MySQL
    Git CMD
  • 原文地址:https://www.cnblogs.com/steven-yang/p/12317646.html
Copyright © 2011-2022 走看看