环境

  • 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. [Swift]LeetCode119. 杨辉三角 II | Pascal's Triangle II

    Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note t ...

  2. [Swift]LeetCode491. 递增子序列 | Increasing Subsequences

    Given an integer array, your task is to find all the different possible increasing subsequences of t ...

  3. [Swift]LeetCode508. 出现次数最多的子树元素和 | Most Frequent Subtree Sum

    Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a ...

  4. Kubernetes 笔记 06 豌豆荚之旅(一)

    本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. Hi,大家好, ...

  5. iOS学习——图片压缩到指定大小以内

    一.图片压缩简述 在我们开发过程中,有可能会遇到拍照.或者从相册中选择图片,要么单选或者多选,然后上传图片到服务器,一般情况下一张图片可能3-4M,如果类似微信朋友圈上传9张图片大约是 35M左右,如 ...

  6. HBase之Table.put客户端流程

    首先,让我们从HTable.put方法开始.由于这一节有很多方法只是简单的参数传递,我就简单略过,但是,关键的方法我还是会截图讲解,所以希望大家尽可能对照源码进行流程分析.另外,在这一节,我单单介绍p ...

  7. scala判断数据类型

    scala判断一个数据或者对象的类型只需要在该对象后面添加 .getClass.getSimpleName : scala> 222.getClass.getSimpleName res1: S ...

  8. BBS论坛(八)

    8.1.发送邮箱验证码功能 (1)cms/resetemail.html {% from 'common/_macros.html' import static %} {% block head %} ...

  9. css3的动画特效--元素旋转(transition,animation)

    开发中,视觉要你实现一个元素的旋转问题,比如说如下图所示: 思路:首先动画动效肯定离不开anmimation动画. 和transition动画一样,animation动画也是CSS3动画的一种,这类动 ...

  10. 翻译 Asp.Net Core 2.2.0-preview1已经发布

    Asp.Net Core 2.2.0-preview1已经发布 原文地址 ASP.NET Core 2.2.0-preview1 now available 今天我们很高兴地宣布,现在可以试用ASP. ...