环境

  • windows10(1803)

  • Nexus Repository Manager OSS 3.x

下载与安装

  1. 在官网下载Nexus Repository Manager OSS 3.x, 解压至任意位置.
  2. 管理员运行 powershell, 切换到 nexus-3.13.0-01/bin 目录

    $./nexus.exe /install 进行安装, 成功后会提示 Installed service 'nexus

    $./nexus.exe /run 运行服务, 第一次要耐心等待很久

  3. 等待启动完毕后, 进入 http://127.0.0.1:8081, 点击右上角 Sign In 登陆, 默认账号: admin 密码: admin123

添加npm仓库

以下输入的Name都是根据自己需求修改

  • 点击在左侧菜单Repositories, 然后点击Create repository按钮.
  • 选择 npm(proxy), 输入 Name: npm-proxy, remote storage 填写 https://registry.npm.taobao.orghttps://registry.npmjs.org. 用于将包情求代理到地址地址
  • 再次点击Create repository按钮., 增加 npm(hossted) 输入 Name: npm-xueyou 用于存放自己的私有包
  • 再次点击Create repository按钮.,增加npm(group) 输入 Name: npm-all, 下面Member repositories里选择之前添加的2个移动右边

配置与验证npm仓库

  • $npm config set registry http://localhost:8081/repository/npm-all/ 这里的url在仓库 npm-all 右边有获取url
  • 随便进入一个目录, 初始化package, npm init -y, npm --loglevel info install grunt 查看是否从自己的仓库地址拉取包
  • 设置权限, Realms 菜单, 将 npm Bearer Token Realm 添加到右边
  • 添加用户, 然后 npm login –registry=http://192.168.0.102:8081/repository/npm-all/ 进行登陆,需要填写账号、密码以及邮箱
  • 登陆 npm login --registry=http://192.168.0.102:8081/repository/npm-all/ 输入刚才新建用户的用户和密码和邮箱

发布自己的包

确保要发布的模块跟目录有 package.json 文件

  1. 添加用户 npm adduser -registry http://192.168.0.102:8081/repository/npm-xueyou/
  2. 发布包, npm publish –registry http://192.168.0.102:8081/repository/npm-xueyou/
  3. 修改 package.json 添加 "publishConfig": { "registry": "http://192.168.0.102:8081/repository/npm-xueyou/" }, 这样直接npm publish就发布了

Nexus开启启动

  1. nexus/bin 目录添加到环境变量
  2. 新建 nexus-start.bat 输入 nexus.exe /run 保存
  3. win + r 输入 shell:startup 打开 C:\Users\tangdekun\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 目录, 将文件放进

脚注

Node Packaged Modules and npm Registries
上传本地服务器
开启启动

使用 Nexus Repository Manager 搭建 npm 私服的更多相关文章

  1. 使用 Nexus3 Repository Manager 搭建 npm 私服

    公司里一般都有自己的私服,用于管理封装的工具插件等,Nexus2主要是用于maven/gralde仓库的统一管理,Nexus3则添加了npm插件,可以对npm提供支持,其实用于npm仓库管理的还有一个 ...

  2. 使用 Nexus Repository Manager 搭建私有docker仓库

    使用容器安装Nexus3 1.下载nexus3的镜像: docker pull sonatype/nexus3 2.使用镜像启动一个容器: docker run -d --name nexus  -- ...

  3. docker+Nexus Repository Manager 搭建私有docker仓库

    使用容器安装Nexus3 1.下载nexus3的镜像: docker pull sonatype/nexus3 2.使用镜像启动一个容器: docker run -d -p 8081:8081 -p ...

  4. Maven私服搭建(Nexus Repository Manager 3)

    下载和安装 下载地址:https://help.sonatype.com/repomanager3/download 注意:Nexus Repository Manager 3是一个Java服务器应用 ...

  5. Nexus 3 搭建 npm 私服 (windows)

    Nexus 3 搭建 npm 私服备忘 下载与安装 在官网下载Nexus Repository Manager OSS 3.x, 解压至任意位置. 管理员运行 powershell, 切换到 nexu ...

  6. [转] 使用HTTPS在Nexus Repository Manager 3.0上搭建私有Docker仓库

    FROM: https://www.hifreud.com/2018/06/06/03-nexus-docker-repository-with-ssl/ 搭建方式 搭建SSL的Nexus官方提供两种 ...

  7. Nexus Repository Manager OSS 3.x 安装配置

    前言想要使用maven搭建项目,但是国内的网络环境可以想象,还有公司自己开发的jar包等问题,所以需要搭建一个maven的私服,这样便于管理. 找了一些教程,顺便记下来,当做笔记. 本文以Window ...

  8. Nexus Repository Manager 3(CVE-2019-7238) 远程代码执行漏洞分析和复现

    0x00 漏洞背景 Nexus Repository Manager 3是一款软件仓库,可以用来存储和分发Maven,NuGET等软件源仓库.其3.14.0及之前版本中,存在一处基于OrientDB自 ...

  9. 威胁快报|Nexus Repository Manager 3新漏洞已被用于挖矿木马传播,建议用户尽快修复

    背景 近日,阿里云安全监测到watchbog挖矿木马使用新曝光的Nexus Repository Manager 3远程代码执行漏洞(CVE-2019-7238)进行攻击并挖矿的事件. 值得注意的是, ...

随机推荐

  1. [Java]LeetCode278. 第一个错误的版本 | First Bad Version

    You are a product manager and currently leading a team to develop a new product. Unfortunately, the ...

  2. [Swift]LeetCode922.按奇偶排序数组 II | Sort Array By Parity II

    Given an array A of non-negative integers, half of the integers in A are odd, and half of the intege ...

  3. [Swift]LeetCode1029. 两地调度 | Two City Scheduling

    There are 2N people a company is planning to interview. The cost of flying the i-th person to city A ...

  4. LongAdder 测试

    import org.slf4j.Logger;import org.slf4j.LoggerFactory; import java.util.concurrent.CountDownLatch;i ...

  5. JVM内存知识备忘

    又是一篇备忘... 主要记录一些知识,进行一些资源的汇总. 先来群里liufor大大提供的两张图,清晰易懂: Dockerized Java https://www.youtube.com/watch ...

  6. C++中int与string的转化

    C++中int与string的转化 int本身也要用一串字符表示,前后没有双引号,告诉编译器把它当作一个数解释.缺省情况下,是当成10进制(dec)来解释,如果想用8进制,16进制,怎么办?加上前缀, ...

  7. 实现无缝兼容ajax/websocket网页应用和服务

    为了让用户体验更好,页面前端往往是通过ajax来进行数据处理:由于浏览器的设计原因每个域名下的连接有限,这样导致了同时进行ajax数据请求效率无法得到有效地提升,为了提高效率和传统HTTP协议上的限制 ...

  8. Chapter 5 Blood Type——31

    I stood carefully, and I was still fine. He held the door for me, his smile polite but his eyes mock ...

  9. import 和 export

    1.export 命令 export 命令用于规定模块的对外接口. 一个模块就是一个独立的文件.该文件内部所有的变量,外部无法获取.要想外部能够读取模块内部的某个变量,就必须使用 export 关键字 ...

  10. ASP.NET MVC5多语言切换快速实现方案

    功能 实现动态切换语言,Demo做了三种语言库可以切换,包括资源文件的定义,实体对象属性设置,后台代码Controller,IAuthorizationFilter,HtmlHelper的实现,做法比 ...