zoukankan      html  css  js  c++  java
  • 私有npm库搭建(verdaccio)

    1. 安装 verdaccio

    npm install verdaccio -g

    2. 安装完成后直接运行命令 verdaccio 启动服务即可

      2.1 图中的.yaml就是配置文件,可以vim 图中yaml文件的路径去自定义配置

    3. 添加用户,运行下方命令注册用户,根据提示输入用户名密码邮箱等信息

      npm adduser –registry http://localhost:4873

    4. 发布

      npm publish --registry http://localhost:4873

     

    5. 配置文件

    # #号后面是注释
    # 所有包的缓存目录
    storage: ./storage
    # 插件目录
    plugins: ./plugins
    
    #开启web 服务,能够通过web 访问
    web:
      # WebUI is enabled as default, if you want disable it, just uncomment this line
      #enable: false
      title: Verdaccio
    #验证信息
    auth:
      htpasswd:
        #  用户信息存储目录
        file: ./htpasswd
        # Maximum amount of users allowed to register, defaults to "+inf".
        # You can set this to -1 to disable registration.
        #max_users: 1000
    
    # a list of other known repositories we can talk to
    #公有仓库配置(这里使用淘宝镜像)
    uplinks:
      npmjs:
       # url: https://registry.npmjs.org/
        url: https://registry.npmmirror.com/
    
    packages:
      '@*/*':
        # scoped packages
        access: $all
        publish: $authenticated
    
        #代理 表示没有的仓库会去这个npmjs 里面去找 ,
        #npmjs 又指向  https://registry.npmjs.org/ ,就是上面的 uplinks 配置
        proxy: npmjs
    
      '**':
        # 三种身份,所有人,匿名用户,认证(登陆)用户
        # "$all", "$anonymous", "$authenticated"
    
        #是否可访问所需要的权限
        access: $all
    
        #发布package 的权限
        publish: $authenticated
    
        # 如果package 不存在,就向代理的上游服务发起请求
        proxy: npmjs
    
    # To use `npm audit` uncomment the following section
    middlewares:
      audit:
        enabled: true
    # 监听的端口 ,重点, 不配置这个,只能本机能访问 端口可以修改
    listen: 0.0.0.0:4873
    # log settings
    logs:
      - {type: stdout, format: pretty, level: http}
      #- {type: file, path: verdaccio.log, level: info}

     

  • 相关阅读:
    Linux 下的dd命令使用详解
    理解Linux的inode
    2021.11.11
    转一篇DLL逆向的文章,适用于一般的dll逆向
    关于Exchange DSAccess组件目录检测机制
    一些KB
    Inside of my heart
    C/C++是程序员必须掌握的语言吗?
    一个自动检测并安装hotfix的脚本
    VC++中DLL的创建和使用
  • 原文地址:https://www.cnblogs.com/chefweb/p/15655796.html
Copyright © 2011-2022 走看看