使用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 源名

 

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