Server
server:all developers can have access to it, the server environment is windows.
We need to use the npm command to install verdaccio, so we have to have a node environment.
step1: install the node environment
Download node
install node
Verify that the installation was successful
Open cmd and input "node -v"
step2:Installation start verdaccio
Install verdaccio
Open cmd and input "npm install -g verdaccio"
Start verdaccio
input "verdaccio"
After the startup is successful, open http://localhost:4873/ and see the interface is successful.
Configuration file
Find the configuration file of verdaccio, You can modify the configuration by referring to https://verdaccio.org/docs/en...
verdaccio runs by default in the port 4873,we can change the listen address and port.
After change the configurations,then restart the verdaccio, open http://10.137.118.26:3001/#/ and can see the interface like below
The private repository has been set up.
Client configurationWe need to use our client to configure our registry to use our private repository.The client is the developer"s development computer.You need to install the node environment.
npm release package
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://10.137.118.26:3001 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://10.137.118.26:3001 and then entering the username and password. Then enter the code directory we need to upload, execute the command to publish.
Just got a project name called "example", there is nothing in it, npm init creates a new package.json.The package.json code is as follows:
register account like below:
when we register a account,it will auto login.
Then we can use the npm publish command to publish the package.
And,we can see the package published success.
npm download package
Just open a project called "test", Use the command npm install "@sfc/example" to download the npm package we just posted to private.
After the download is complete, we can see the example file in the node_modules folder of the project.
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/109531.html
摘要:本文介绍如何使用搭建私有仓库,以及使用时如何映射到本地目录,方便简单对仓库进行各种操作。其次,创建目录,并添加的配置文件。当需要把某个项目发布到私有库时,直接。使用包名,即可安装私有包了。本文介绍如何使用 verdaccio 搭建私有npm仓库,以及使用 docker 时如何映射到本地目录,方便简单对仓库进行各种操作。系统环境是 Linux。 verdaccio verdacci...
摘要:前端开发过程中,少不了自己封装一些通用的包,但又不想放在公共的平台,所以搭建一个私有的仓库是很有必要的。在这里简单介绍如何使用在环境下的配置。轻量级私有代理注册表。加上,那就真的无敌方便了,搭建一个私有仓库轻轻松松几分钟搞定。前端开发过程中,少不了自己封装一些通用的包,但又不想放在公共的平台,所以搭建一个npm私有的仓库是很有必要的。 在这里简单介绍如何使用 verdoccio 在docke...
摘要: 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 v...
摘要:原因我搭私库的原因很简单,目前正在开发一个组件库,提供给公司内部使用,我不想去注册,也不想等待的审核,只想要有个仓库快速测试发布自己的包。我一般会通过启动,原因很简单,关闭窗口后,服务不会停掉,并且能很好的管理我们启动的服务。 原因 我搭私库的原因很简单,目前正在开发一个组件库,提供给公司内部使用,我不想去注册npm,也不想等待npm的审核,只想要有个仓库快速测试发布自己的npm包。 ...
阅读 776·2023-04-26 03:04
阅读 2859·2021-11-15 18:10
阅读 1187·2021-09-03 10:28
阅读 1125·2019-08-30 15:53
阅读 876·2019-08-30 12:45
阅读 1950·2019-08-30 11:03
阅读 2861·2019-08-29 14:01
阅读 2924·2019-08-28 18:24