使用verdaccio搭建本地[离线]npm镜像库

 

安装verdaccio

# 使用 npm 安装
npm install -g verdaccio

启动服务

verdaccio

修改配置文件

> config file -  */config.yaml 配置文件

# path to a directory with all packages
storage: D:/storage #存储仓库
# path to a directory with plugins to include
plugins: ./plugins

直接使用

# 换源
npm set registry http://localhost:4873

 

安装nrm

npm install -g nrm

nrm ls查看可选的源


* npm -------- https://registry.npmjs.org/
  yarn ------- https://registry.yarnpkg.com/
  cnpm ------- http://r.cnpmjs.org/
  taobao ----- https://registry.npm.taobao.org/
  nj --------- https://registry.nodejitsu.com/
  npmMirror -- https://skimdb.npmjs.com/registry/
  edunpm ----- http://registry.enpmjs.org/

增加源

nrm add 源名 地址
# nrm add verdaccio http://localhost:4873

使用源(切换源)

nrm use 源名

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章