当前位置:   article > 正文

Verdaccio 私服搭建_verdaccio 重启

verdaccio 重启

安装 verdaccio

1、安装

npm install -g verdaccio
  • 1

2、查看帮助

verdaccio -h
  • 1

3、运行

verdaccio
  • 1

3.1 如果需要后台运行,不受终端回话的影响

– hoax不生效

nohup verdaccio &
  • 1

– 通过pm2启动守护进程

npm install -g pm2
pm2 start verdaccio
pm2 list
  • 1
  • 2
  • 3

pm2 list

4、成功后会打印信息

```bash
 info --- Creating default config file in C:\Users\Administrator\AppData\Roaming\verdaccio\config.yaml
 warn --- config file  - C:\Users\Administrator\AppData\Roaming\verdaccio\config.yaml
 warn --- "crypt" algorithm is deprecated consider switch to "bcrypt". Read more: https://github.com/verdaccio/monorepo/pull/580
 info --- plugin successfully loaded: verdaccio-htpasswd
 info --- plugin successfully loaded: verdaccio-audit
 warn --- http address - http://localhost:4873/ - verdaccio/5.15.4
 http --- 127.0.0.1 requested 'GET /'
 http --- 200, user: null(127.0.0.1), req: 'GET /', bytes: 0/505
 http --- 127.0.0.1 requested 'GET /-/verdaccio/data/packages'
 http --- 200, user: null(127.0.0.1), req: 'GET /-/verdaccio/data/packages', bytes: 0/2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

以上会有 config.yaml 的路径,可进入配置

5、修改配置,把 端口监听改为所有ip,不然只有localhost能访问网页

vim 路径/verdaccio/config.yaml
  • 1
listen:
	   - 0.0.0.0:4873         
  • 1
  • 2

6、修改配置记得重启 verdaccio

7、如果需要本地打好的包,传到 私服,此处以测试环境服务器为例
7.1 先登录

npm adduser --registry http://192.168.111.66:4873/
  • 1

7.2 再上传

npm publish --registry http://192.168.111.66:4873
  • 1

这样就完成了上传

使用 nrm 管理npm源

安装 npm i -g nrm 管理npm源
1、查看源

npm i -g nrm
  • 1

2、添加本地的npm源

nrm add denglianyu http://192.168.111.14:4873
  • 1

3、查看所有的已添加源

nrm ls
  • 1

查看以上添加的 denglianyu 源是否存在

4、使用某个源,如:denglianyu

nrm use denglianyu
  • 1

注册用户

1、注册

npm addUser
>
Username: root
Password:
Email: (this IS public) 1848659618@qq.com
Logged in as root on http://192.168.111.14:4873/.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

2、注册后会自动登录

发布私有包

1、进入需要发布的包,如:

D:project\...\packages\pub-core
  • 1

2、npm publish

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/632689
推荐阅读
相关标签
  

闽ICP备14008679号