搭建私有npm库

101 阅读1分钟

1、安装

   npm install -g verdaccio
   verdaccio

2、配置

    ~/.config/verdaccio/config.yaml 查看配置信息

3、包管理

    npm install -g nrm 
    nrm add test http://localhost:4873 
    nrm use test 
    npm adduser --registry http://localhost:4873 // 添加用户 
    npm login --registry=http://localhost:4873 // 登录 
    // 包的版本如何管理? 0.0.1 
    npm publish --registry http://localhost:4873 // 发布 
    npm unpublish npm-test

4、ng配置

截屏2022-08-19 下午3.22.26.png

5、参考文章

juejin.cn/post/692448…

verdaccio.org/zh-cn/docs