当前位置:网站首页>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 ~
边栏推荐
猜你喜欢
Look at the sky at dawn and the clouds at dusk, and enjoy the beautiful pictures
Wave animation color five pointed star loader loading JS special effects
MHA high availability cluster deployment and failover of database
Different test techniques
【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
简单的两个圆球loading加载
Use Net core access wechat official account development
Meta再放大招!VR新模型登CVPR Oral:像人一样「读」懂语音
硬件开发笔记(九): 硬件开发基本流程,制作一个USB转RS232的模块(八):创建asm1117-3.3V封装库并关联原理图元器件
logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
随机推荐
彩色五角星SVG动态网页背景js特效
SSO and JWT good article sorting
Class initialization and instantiation
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
网络socket的状态要怎么统计?
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
晓看天色暮看云,美图欣赏
Perl 5.10.0 installation package download
Nc100 converts strings to integers (ATOI)
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
使用nvm管理nodejs(把高版本降级为低版本)
leetcode:241. Design priority for operation expression [DFS + Eval]
Fiori applications are shared through the enhancement of adaptation project
Mobile note application
买卖其实也有风险
有人碰到过这种情况吗,oracle logminer 同步的时候,clob字段的值丢失
Which securities company has a low, safe and reliable account opening commission
机器学习—性能度量
有没有大佬 遇到过flink监控postgresql数据库, 检查点无法使用的问题
R语言使用yardstick包的conf_mat函数计算多分类(Multiclass)模型在每个交叉验证(或者重采样)的每一折fold上的混淆矩阵、并使用summary输出每个fold的其它详细指标