Verdaccio介绍及安装 -- nodejs私有npm proxy registry代理
Verdaccio 是一個 Node.js創(chuàng)建的輕量的私有npm proxy registry
Verdaccio 是一個跨平臺的 Web 應(yīng)用程序。 在安裝之前,您需要確保系統(tǒng)環(huán)境已滿足以下條件。
Prerequisites
我們強烈建議使用最新版本的Node包管理工具,比如> npm@6.x | yarn@1.x | | yarn@2.x | pnpm@6.x。 不再支持npm@5.x或更低版本。
Verdaccio 將根據(jù) Node. js 發(fā)布工作組 的推薦支持最新的 Node. js 版本。
仍在使用 Verdaccio 4? 查看 遷移指南。
快速開始
在開始之前學(xué)習(xí)基礎(chǔ):如何安裝、配置文件的位置在哪里等等。
安裝CLI
在生產(chǎn)環(huán)境中使用Verdaccio前,請先閱讀并了解 最佳實踐案例。
Verdaccio must be installed globally using either of the following methods:
Using npm
npm install -g verdaccioor using yarn
yarn global add verdaccioor using pnpm
$> verdaccio warn --- config file - /home/.config/verdaccio/config.yaml warn --- http address - http://localhost:4873/ - verdaccio/3.0.0Docker 鏡像
Once it has been installed, you only need to execute the CLI command:
$> verdaccio warn --- config file - /home/.config/verdaccio/config.yaml warn --- http address - http://localhost:4873/ - verdaccio/5.0.0For more information about the CLI, please read the cli section.
You can set the registry by using the following command.
npm set registry http://localhost:4873/you can pass a --registry flag when needed.
npm install --registry http://localhost:4873define in your .npmrc a registry field.
.npmrc
registry=http://localhost:4873Or a publishConfig in your package.json
{"publishConfig": {"registry": "http://localhost:4873"} }Docker Image
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio Verdacciohas an official docker image you can use, and in most cases, the default configuration is good enough. For more information about how to install the official image,
read the docker section
.
官方文檔鏈接:https://verdaccio.org/zh-CN/docs/installation
總結(jié)
以上是生活随笔為你收集整理的Verdaccio介绍及安装 -- nodejs私有npm proxy registry代理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: gitlab备份与还原:配置文件解读、定
- 下一篇: golang文件操作:打开关闭文件,带缓