当前位置:网站首页>Nexus builds NPM dependent private database
Nexus builds NPM dependent private database
2022-07-01 13:06:00 【An operation and maintenance young man】
nexus build npm Rely on Private Library
npm The warehouse is introduced
3.2.1. Default warehouse description
npm-proxy: Can be represented npmjs And Taobao mirror image
npm-hosted: For uploading 、 Customized and personal development npm Components
npm-public: Warehouse groups , Put several warehouse groups together .
3.2.1. Warehouse type
Group: This is a concept of warehouse aggregation , User warehouse address selection Group The address of , Can access Group Configured in , For the convenience of developers to set their own warehouse .maven-public It's just one. Group Type of warehouse , Multiple warehouses are set up inside , The order of access depends on the order of configuration ,3.x Silent Releases,Snapshots, Central, Of course, you can set it yourself .
Hosted: Private warehouse , Internal project release warehouse , Dedicated to storing our own generated jar file
3rd party: Third parties not published to the public network jar (3.x In addition to the )
Snapshots: Snapshot repository for local projects
Releases: Official release of local project
Proxy: Type of agency , Looking for data warehouse from remote central warehouse ( You can click the corresponding warehouse Configuration Under tab Remote Storage The value of the property is the path of the remote warehouse being proxied ), If you can configure alicloud maven Warehouse
Central: The central warehouse
Apache Snapshots:Apache Dedicated snapshot warehouse (3.x In addition to the )
Click on the left menu bar Repositories
, We can see many configured warehouses , Generally, only open source is used jar That's enough. , If you need to create a custom warehouse , Click on Create repository
Create a new warehouse
First, we need to create several commonly used proxy sources , For common open source npm Module pulling .
Add the following proxy sources in sequence
taobao
https://registry.npm.taobao.org/
NPM-npmjs
https://registry.npmjs.org
Add proxy (Cache Set it to 200 God 288000)
Set up maven-public
Add these agents Group
, It is better to default maven Put the library at the bottom , It can be ignored here
establish npm-hosted
, For publishing personal development npm Components .
establish npm-public
, It is used to combine several warehouse groups together for public connection .
Modify local Npm Connection source
notes : This is my private server address , Please make changes according to the actual situation
http://192.168.2.202:8081/
open Repositories
Find the created group npm-public, Click on Copy, Copy the connection source address
Run the following command locally , modify npm Warehouse source
npm config set registry http://192.168.2.202:8081/repository/npm-public/
Publish your own npm Component to private server
Log in to the private server
Copy your own private server address
On the local command console , Enter the following command , Log in to the private server
npm login –registry=http://192.168.2.202:8081/repository/npm-hosted/
Release npm Components
Module to publish , You must ensure that there are... In the root directory package.json file , Otherwise, an error will be reported .
npm publish –registry=http://192.168.2.202:8081/repository/npm-hosted/
Publish an error
Maybe it's because the library I logged in is a group , It's not a development library, so upload an error , Landing again
npm login –registry=http://192.168.2.202:8081/repository/npm-hosted/
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
npm ERR! A complete log of this run can be found in:
terms of settlement
Input in terminal npm config list To get npm Configuration of
find userconfig a
open .npmrc file .
Usually in the last item .
Put the addresses of all private warehouses and NpmToken Delete , And then again yarn perhaps npm install that will do .
Cache dependent packages
Click... On the right side of the warehouse copy Button to copy the source address , Then set the source address in the local environment ,npm config set registry=http://xx/repository/group-npm/
, Execute after switching npm i
,install After success , stay nexus The cache of the project can be seen in the agent warehouse of
- Release
- land
adoptnpm login --registry=xx
( Note the local warehouse address ) - Release
adoptnpm publish --registry=xx
( Note the local warehouse address )
push After success , We can do that hosted The warehouse saw the package we just submitted ~
- push Failure words , Need to be in nexus realms Active in npm bearer token
No login
Small partners who often publish can use npm config edit
modify config file , Copy the following code to config In file , No login
registry=http://xx/repository/npm-all/
save-prefix=~
always-auth=true
_auth=YWRtaW46MTIzMTIz
email=[email protected]
- above _auth= Followed by the password base64 code , Can create new a Text execution
certutil /encode a.txt b.txt
Output to b Text , Copy b The internal skill of the text can , It can also be realized through online tools on the Internet ~
ll/
save-prefix=~
always-auth=true
_auth=YWRtaW46MTIzMTIz
[email protected]
1. above _auth= Followed by the password base64 code , Can create new a Text execution `certutil /encode a.txt b.txt` Output to b Text , Copy b The internal skill of the text can , It can also be realized through online tools on the Internet ~
That's all nexus3 build npm All the contents of the private library , The most important thing is to practice by yourself , In the process of practice, if you encounter problems, learn to think and face Baidu, you can continue to grow ~
边栏推荐
- 路由基础之OSPF LSA详细讲解
- 简单斐波那契(递推)
- VM虚拟机配置动态ip和静态ip访问
- MySQL statistical bill information (Part 2): data import and query
- Operator-1 first acquaintance with operator
- The difference between memcpy and strcpy
- Perl 5.10.0 installation package download
- Mysql间隙锁
- Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
- Fiori 应用通过 Adaptation Project 的增强方式分享
猜你喜欢
ZABBIX 6.0 source code installation and ha configuration
Zabbix 6.0 源码安装以及 HA 配置
shell脚本导入存储过程到数据库
我花上万学带货:3天赚3元,成交靠刷单
晓看天色暮看云,美图欣赏
Vs code setting Click to open a new file window without overwriting the previous window
logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
彩色五角星SVG动态网页背景js特效
简单的两个圆球loading加载
基因检测,如何帮助患者对抗疾病?
随机推荐
Simple two ball loading
codeforces -- 4B. Before an Exam
科学创业三问:关于时机、痛点与重要决策
基因检测,如何帮助患者对抗疾病?
ROS2 Foxy depthai_ ROS tutorial
Mysql间隙锁
软件测试中功能测试流程
基于mysql乐观锁实现秒杀的示例代码
Fiori 应用通过 Adaptation Project 的增强方式分享
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
Feign & Eureka & Zuul & Hystrix 流程
Asp. NETCORE uses dynamic to simplify database access
Localtime can't re-enter. It's a pit
The difference between memcpy and strcpy
Wave animation color five pointed star loader loading JS special effects
Router. use() requires a middleware function but got a Object
商汤科技崩盘 :IPO时已写好的剧本
声明一个抽象类Vehicle,它包含私有变量numOfWheels和公共函数Vehicle(int)、Horn()、setNumOfWheels(int)和getNumOfWheels()。子类Mot
天青色等烟雨
Hardware development notes (9): basic process of hardware development, making a USB to RS232 module (8): create asm1117-3.3v package library and associate principle graphic devices