搭建npm私服

如果公司处于内网办公,且开发的代码不支持开源协议的话,又想使用npm 下载的话 推荐自己搭建私服。

 

1、使用Verdaccio

verdaccio.org/zh-CN/

Verdaccio 是可以帮我们快速构建npm私服的一个工具

 

npm install verdaccio -g

  

运行

verdaccio 直接运行即可

 

 

基本命令

0、运行 verdaccio  指定开启端口 默认 4873
verdaccio --listen 9999

 

 
1、# 指定安装源
npm install --registry http://localhost:4873

 

2、#创建账号

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

 

3、# 发布npm

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

 

4、# 从本地仓库删除包

npm unpublish <package-name> --registry http://localhost:4873

 

 
 
 
 
posted @ 2025-03-12 10:58  蜗牛般庄  阅读(150)  评论(0)    收藏  举报
Title
页脚 HTML 代码