赞
踩
1、安装
npm install -g verdaccio
2、查看帮助
verdaccio -h
3、运行
verdaccio
3.1 如果需要后台运行,不受终端回话的影响
– hoax不生效
nohup verdaccio &
– 通过pm2启动守护进程
npm install -g pm2
pm2 start verdaccio
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
以上会有 config.yaml
的路径,可进入配置
5、修改配置,把 端口监听改为所有ip,不然只有localhost能访问网页
vim 路径/verdaccio/config.yaml
listen:
- 0.0.0.0:4873
6、修改配置记得重启 verdaccio
7、如果需要本地打好的包,传到 私服,此处以测试环境服务器为例
7.1 先登录
npm adduser --registry http://192.168.111.66:4873/
7.2 再上传
npm publish --registry http://192.168.111.66:4873
这样就完成了上传
安装 npm i -g nrm
管理npm源
1、查看源
npm i -g nrm
2、添加本地的npm源
nrm add denglianyu http://192.168.111.14:4873
3、查看所有的已添加源
nrm ls
查看以上添加的 denglianyu
源是否存在
4、使用某个源,如:denglianyu
nrm use denglianyu
1、注册
npm addUser
>
Username: root
Password:
Email: (this IS public) 1848659618@qq.com
Logged in as root on http://192.168.111.14:4873/.
2、注册后会自动登录
1、进入需要发布的包,如:
D:project\...\packages\pub-core
2、npm publish
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。