亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專欄INFORMATION COLUMN

在linux Ubuntu創(chuàng)建npm私有庫

dongfangyiyu / 1162人閱讀

摘要:

Our server environment is linux Ubuntu, this article is mainly about how to build our NPM private library in linux Ubuntu environment.

Install Nodejs

We need to use the npm command to install verdaccio, so first we have to have a node environment.

Step1– Add Node.js PPA
$ sudo apt-get install software-properties-common
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Step 2 – Install Node.js on Ubuntu
$ sudo apt-get install nodejs
Step 3 – Check Node.js and NPM Version

After installing node.js verify and check the installed version.

$ node -v

v12.2.0

Also, check the npm version

$ npm -v
v6.9.0
Install verdaccio
$ sudo npm install -g verdaccio --unsafe-perm=true --allow-root

Add the --unsafe-perm=true --allow-root option to prevent gyp ERR! permission denied permission error like below:

If we install successfull, we can see the result

/usr/bin/verdaccio -> /usr/lib/node_modules/verdaccio/bin/verdaccio
+ verdaccio@3.11.7
Start verdaccio
$ verdaccio

The results are as follows:

 warn --- config file  - /home/npm/.config/verdaccio/config.yaml
 warn --- Plugin successfully loaded: htpasswd
 warn --- Plugin successfully loaded: audit
 warn --- http address - http://localhost:4873/ - verdaccio/3.11.7

From the output of the console, we can see that verdaccio"s configuration file path is in /home/npm/.config/verdaccio/config.yaml and the default access address is http://localhost:4873/

Modify the config

access to the config.yaml file

$ cd /home/npm/.config/verdaccio/
$ ls
config.yaml  htpasswd  storage
$ vim config.yaml

Add the code at the end of the configuration file config.yaml:

# you can specify listen address (or simply a port)
listen: 0.0.0.0:8080

View detailed verdaccio profile documentation

Start verdaccio with command verdaccio
$ verdaccio
Access to a built private repository

Open http://[ip address]:8080 in the browser, if it can be accessed normally, it means that the construction is successful.
Our ip address is 104.43.246.39,open http://104.43.246.39:8080,we can see the interface like below:

notice: Add a security group to the cloud server and open the 8080 port number.
If the port security group is not added, you cannot access the http://104.43.246.39:8080 in the browser.

Start verdaccio with pm2 to ensure that the process is always open

we can also start verdaccio with pm2 to ensure that the process is always open.And we can get more detail.

Install pm2
$ npm install -g pm2 --unsafe-perm=true --allow-root
Start verdaccio with pm2
$ pm2 start verdaccio
stop verdaccio with pm2
$ pm2 stop verdaccio
Let verdaccio run in the background

If you connect to the linux server via putty SSH, when the terminal becomes inactive and the process dies. So we need to run the verdaccio in the background.

run verdaccio in background
$ screen
$ verdaccio

stop the process in background

$ screen ls
There are screens on:
        16129.pts-0.VM-NPM      (05/15/19 09:31:04)     (Detached)
        15809.pts-2.VM-NPM      (05/15/19 09:28:43)     (Detached)

$ screen -r 16129.pts-0.VM-NPM

npm@VM-NPM:/var/www/app$ node server.js
Server started on localhost:8080; press Ctrl-C to terminate...!
Client publishes npm to private repository

After using verdaccio to build a private repository on the server, the next step is how to upload the npm package to the private repository server locally.

you need to register or login your account. If we don"t have an account yet, we can create it by entering the command npm adduser --registry http://104.43.246.39:8080 and then entering the username in turn. If you already have an account, you can log in by entering the command npm login --registry http://104.43.246.39:8080 and then entering the username and password. Then enter the code directory we need to upload, execute the command to publish.

You must first register an account before publishing the npm package.

npm adduser --registry  http://104.43.246.39:8080
Username: jane
Password: 
Email: (this IS public) 924902324@qq.com
Logged in as jane on http://104.43.246.39:8080.

The output Logged in as jane on http://104.43.246.39:8080., indicating that the npm account jane successfully logged into the http://104.43.246.39:8080 private repository.

Just got a project name called "example", there is nothing in it, npm init creates a new package.json.

npm init
npm publish --registry http://104.43.246.39:8080
Npm successfully released to private repository

Refresh the http://104.43.246.39:8080 page in the browser, as shown in the figure:

How to use the private repository npm package Step1- change the npm registry address
npm set registry http://104.43.246.39:8080
Step2- Install package
npm install @sfc/example

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/109549.html

相關(guān)文章

  • Flux7 Docker 系列教程(一):Docker 簡介

    摘要:本系列教程翻譯自,系列共有九篇,本文譯自第一篇。,一種新的容器化技術(shù),因?yàn)檩p量級(jí)和便攜化而受到廣泛關(guān)注。本篇文章是系列教程的第一篇。鏡像只讀的容器模板,簡言之就是系統(tǒng)鏡像文件。首先,向發(fā)出請(qǐng)求創(chuàng)建一個(gè)鏡像并且指定容器內(nèi)要運(yùn)行的命令。 本系列教程翻譯自 Flux7 Docker Tutorial Series,系列共有九篇,本文譯自第一篇 Part 1: An Introduction。...

    zhaofeihao 評(píng)論0 收藏0
  • Flux7 Docker 系列教程(一):Docker 簡介

    摘要:本系列教程翻譯自,系列共有九篇,本文譯自第一篇。,一種新的容器化技術(shù),因?yàn)檩p量級(jí)和便攜化而受到廣泛關(guān)注。本篇文章是系列教程的第一篇。鏡像只讀的容器模板,簡言之就是系統(tǒng)鏡像文件。首先,向發(fā)出請(qǐng)求創(chuàng)建一個(gè)鏡像并且指定容器內(nèi)要運(yùn)行的命令。 本系列教程翻譯自 Flux7 Docker Tutorial Series,系列共有九篇,本文譯自第一篇 Part 1: An Introduction。...

    yacheng 評(píng)論0 收藏0
  • 可能是最詳細(xì)的部署:Docker Registry企業(yè)級(jí)私有鏡像倉Harbor管理WEB UI

    摘要:私有倉庫是,并在中運(yùn)行。不要使用或?yàn)橹鳈C(jī)名注冊(cè)表服務(wù)需要由外部客戶端訪問或,默認(rèn)為用于訪問和令牌通知服務(wù)的協(xié)議。打開或關(guān)閉,默認(rèn)打開打開此屬性時(shí),準(zhǔn)備腳本創(chuàng)建私鑰和根證書,用于生成驗(yàn)證注冊(cè)表令牌。 上一篇文章搭建了一個(gè)具有基礎(chǔ)功能,權(quán)限認(rèn)證、TLS 的私有倉庫,但是Docker Registry 作為鏡像倉庫,連管理界面都沒有,甚至連一些運(yùn)維必備的功能都是缺失的,還有什么 Docker...

    沈儉 評(píng)論0 收藏0
  • Docker Registry Server 搭建,配置免費(fèi)HTTPS證書,及擁有權(quán)限認(rèn)證、TLS

    摘要:上一篇文章搭建了一個(gè)具有基礎(chǔ)功能的私有倉庫,這次來搭建一個(gè)擁有權(quán)限認(rèn)證的私有倉庫。移動(dòng)證書到目錄。身份驗(yàn)證為用戶創(chuàng)建一個(gè)帶有一個(gè)條目的密碼文件,密碼為創(chuàng)建倉庫啟動(dòng)注冊(cè)表,指示它使用證書。注冊(cè)表在端口默認(rèn)的端口上運(yùn)行。 上一篇文章搭建了一個(gè)具有基礎(chǔ)功能的私有倉庫,這次來搭建一個(gè)擁有權(quán)限認(rèn)證、TLS 的私有倉庫。 環(huán)境準(zhǔn)備 系統(tǒng):Ubuntu 17.04 x64 IP:198.13.48...

    liuchengxu 評(píng)論0 收藏0
  • 全棧工程師之路——服務(wù)器端自動(dòng)部署

    摘要:如果你想要成為一名全棧工程師,那么就必須要學(xué)會(huì),學(xué)會(huì)線上服務(wù)器部署和發(fā)布。準(zhǔn)備為了避免個(gè)人花錢買云服務(wù)器。用戶名必須正確,否則會(huì)提示服務(wù)器拒絕密碼。還有一個(gè)這個(gè)是自動(dòng)部署需要的,目錄結(jié)構(gòu)如下這文件的配置很重要。 前言 作為一名前端工程師,不僅要能寫前端頁面,還要懂前端工程,各種庫,各種框架,各種衍生語言,信手捏來。如果你想要成為一名全棧工程師,那么就必須要學(xué)會(huì)Node.js,學(xué)會(huì)線上服...

    OpenDigg 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

閱讀需要支付1元查看
<