使用 Nexus Repository Manager 搭建 npm 私服
环境
windows10(1803)
Nexus Repository Manager OSS 3.x
下载与安装
- 在官网下载Nexus Repository Manager OSS 3.x, 解压至任意位置.
管理员运行 powershell, 切换到 nexus-3.13.0-01/bin 目录
$
./nexus.exe /install进行安装, 成功后会提示Installed service 'nexus$
./nexus.exe /run运行服务, 第一次要耐心等待很久等待启动完毕后, 进入
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.org 或 https://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 文件
- 添加用户
npm adduser -registry http://192.168.0.102:8081/repository/npm-xueyou/ - 发布包, npm publish –registry http://192.168.0.102:8081/repository/npm-xueyou/
- 修改 package.json 添加
"publishConfig": { "registry": "http://192.168.0.102:8081/repository/npm-xueyou/" }, 这样直接npm publish就发布了
Nexus开启启动
nexus/bin目录添加到环境变量- 新建
nexus-start.bat输入nexus.exe /run保存 - 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 私服的更多相关文章
- 使用 Nexus3 Repository Manager 搭建 npm 私服
公司里一般都有自己的私服,用于管理封装的工具插件等,Nexus2主要是用于maven/gralde仓库的统一管理,Nexus3则添加了npm插件,可以对npm提供支持,其实用于npm仓库管理的还有一个 ...
- 使用 Nexus Repository Manager 搭建私有docker仓库
使用容器安装Nexus3 1.下载nexus3的镜像: docker pull sonatype/nexus3 2.使用镜像启动一个容器: docker run -d --name nexus -- ...
- docker+Nexus Repository Manager 搭建私有docker仓库
使用容器安装Nexus3 1.下载nexus3的镜像: docker pull sonatype/nexus3 2.使用镜像启动一个容器: docker run -d -p 8081:8081 -p ...
- Maven私服搭建(Nexus Repository Manager 3)
下载和安装 下载地址:https://help.sonatype.com/repomanager3/download 注意:Nexus Repository Manager 3是一个Java服务器应用 ...
- Nexus 3 搭建 npm 私服 (windows)
Nexus 3 搭建 npm 私服备忘 下载与安装 在官网下载Nexus Repository Manager OSS 3.x, 解压至任意位置. 管理员运行 powershell, 切换到 nexu ...
- [转] 使用HTTPS在Nexus Repository Manager 3.0上搭建私有Docker仓库
FROM: https://www.hifreud.com/2018/06/06/03-nexus-docker-repository-with-ssl/ 搭建方式 搭建SSL的Nexus官方提供两种 ...
- Nexus Repository Manager OSS 3.x 安装配置
前言想要使用maven搭建项目,但是国内的网络环境可以想象,还有公司自己开发的jar包等问题,所以需要搭建一个maven的私服,这样便于管理. 找了一些教程,顺便记下来,当做笔记. 本文以Window ...
- Nexus Repository Manager 3(CVE-2019-7238) 远程代码执行漏洞分析和复现
0x00 漏洞背景 Nexus Repository Manager 3是一款软件仓库,可以用来存储和分发Maven,NuGET等软件源仓库.其3.14.0及之前版本中,存在一处基于OrientDB自 ...
- 威胁快报|Nexus Repository Manager 3新漏洞已被用于挖矿木马传播,建议用户尽快修复
背景 近日,阿里云安全监测到watchbog挖矿木马使用新曝光的Nexus Repository Manager 3远程代码执行漏洞(CVE-2019-7238)进行攻击并挖矿的事件. 值得注意的是, ...
随机推荐
- [Swift]LeetCode51. N皇后 | N-Queens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens ...
- [Swift]LeetCode348. 设计井字棋游戏 $ Design Tic-Tac-Toe
Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the fol ...
- [Swift]LeetCode358. 按距离为k隔离重排字符串 $ Rearrange String k Distance Apart
Given a non-empty string str and an integer k, rearrange the string such that the same characters ar ...
- This relative module was not found:
晚上项目敲完,关机睡觉! 早上醒来-----打开项目,惊呆了 !This relative module was not found: 如图 这个报错,我当时怎么也没看懂!!! 后来经过测试 ...
- HBase之CF持久化系列(续3——完结篇)
相信大家在看了该系列的前两篇文章就已经对其中的持久化有比较深入的了解.相对而言,本节内容只是对前两节的一个巩固.与持久化相对应的是打开文件并将其内容读入到内存变量中.而在本节,我就来介绍这一点. 本节 ...
- 5.Git基础-撤销操作、标签的使用、Git别名
1.撤销操作 1.1 修改上一次的提交(commit)-- git commit --amend 有时候我们在提交完成之后才发现有几个文件没有提交,或者发现提交信息填写错了,这时候可以使用 git ...
- Django+Bootstrap+Mysql 搭建个人博客(二)
2.1.博客首页设计 (1)settings.py MEDIA_ROOT = os.path.join(BASE_DIR,'media').replace("//","/ ...
- jni c++
java与c/c++之间的数据交互 JNI 上述两篇文章对jni的讲解比较详细,各有利弊,就文章1来说,开门见山,直接阐述了java和C/C++的交互方式:文章2是一篇百度文库 ...
- VS 2013 professional版在win10上安装出错的解决方法
VS 2013 professional版在win10上安装出错的解决方法 win10上安装完VS 2012 professional和VS 2017 professional后,由于项目的需要,要在 ...
- 两种方法操作其它mac应用的窗口
(图文基本无关) 如果单纯说简单方便,其使用AppleScript更好,特别是现在有了JS的加入,比如: (* This Apple script will resize any program wi ...