verdaccio 搭建npm私有库

130 阅读1分钟

安装 verdaccio

npm install -g verdaccio

启动 verdaccio

verdaccio

image.png

打开 http://localhost:4873 ,可以看到一下指引

image.png

登录注册用户

npm adduser --registry http://localhost:4873

发布

cd到要发布的私有npm项目,发布npm包

npm publish --registry http://localhost:4873

安装 nrm 管理 npm源

npm install -g nrm

nrm

image.png

新增私有npm源

nrm add test http://localhost:4873

使用私有npm源

nrm use test

查看npm源列表

nrm ls

image.png

登陆私有库账号

npm login test [前面登陆注册的用户名]