zoukankan      html  css  js  c++  java
  • npm 私服工具verdaccio 安装配置试用

     
    1. 安装
    npm install -g verdaccio
    2. 启动
    verdaccio
    
    // 界面显示信息
    Verdaccio doesn't need superuser privileges. Don't run it und
     warn --- config file  - /root/.config/verdaccio/config.yaml
     warn --- http address - http://localhost:4873/ - verdaccio/
    3. 配置
    a. 监听端口
    //  默认只能本地访问,远程访问配置
    /root/.config/verdaccio/config.yaml
    listen:
    # - localhost:4873            # default value
    # - http://localhost:4873     # same thing
      - 0.0.0.0:4873              # listen on all addresses (INADDR_ANY)
    # - https://example.org:4873  # if you want to use https
    # - [::1]:4873                # ipv6
    # - unix:/tmp/verdaccio.sock    # unix socket
    b. 用户账户管理
    // 默认使用htpasswd 进行管理的,网上也有ldap 的插件
    npm adduser --registry http://localhost:4873
    类似如下:
    Username: rong
    Password: 
    Email: (this IS public) demo@qq.com
    Logged in as rong on http://localhost:4873/.
    4. 登录界面
     
     
    5. 创建私有包
    npm init -f 
    
    touch index.js
    
    var user ={
     name:"dalong",
     age:33
    }
    module.exports=user;
    
    npm adduser --registry http://xxxxxx:4873
    
    npm publish --registry http://xxxx:4873
    
    // ok  具体的操作就是这样
    6.  效果效果
     
     
     
     
    数据存储目录
     
    7. 总结
    总的来说使用起来还是比较简单的,同时官方也提供了docker 的 image 对于开发,持续集成还是比较简单的,
    
    备注:对于服务启动,建议别用root 不然会有一些特殊的问题,大家应该懂得,同时启动的时候也有提示,说白了
    大家只要准守规范,什么事情都会比较简单了。类似的工具比较多,目前集成全家桶的nexus(maven bower docker npm ...) 
    也是挺不错的工具,可以方便开发
    8. 参考文档
    https://github.com/verdaccio/verdaccio
  • 相关阅读:
    关于总线的总结
    我已经理解了并发和并行的区别
    关于CPU的一些基本知识总结
    shell生成指定长度的随机数
    进程、线程、协程、例程、过程的区别是什么?
    Perl输出带颜色行号或普通输出行
    Ruby数组(2):数组方法详细整理
    Linux find常用用法示例
    MariaDB官方手册翻译
    Ruby中to_s和to_str、to_i和to_int、to_a和to_ary、to_h和to_hash的解释说明
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/7811838.html
Copyright © 2011-2022 走看看