0
点赞
收藏
分享

微信扫一扫

Verdaccio介绍及安装 -- nodejs私有npm proxy registry代理

快乐小码农 2022-03-11 阅读 56

Prerequisites

  1. Node.js v12 or higher.
  2. npm >=4.xyarn > 我们强烈建议使用最新的 Node 包管理客户端 > npm@5.x | yarn@1.x | pnpm@2.x
  1. 使用现代浏览器以访问Web界面, 支持使用 Chrome、 Firefox、 Edge和IE11 浏览器。

仍在使用 Verdaccio 4? 查看 迁移指南。

快速开始

在开始之前学习基础:如何安装、配置文件的位置在哪里等等。

安装CLI

Verdaccio must be installed globally using either of the following methods:

Using npm

npm install -g verdaccio

or using yarn

yarn global add verdaccio

or using pnpm

$> verdaccio
warn --- config file  - /home/.config/verdaccio/config.yaml
warn --- http address - http://localhost:4873/ - verdaccio/3.0.0

Docker 镜像

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.0

For 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:4873

define in your .npmrc a registry field.

.npmrc

registry=http://localhost:4873

Or a publishConfig in your package.json

{
  "publishConfig": {
    "registry": "http://localhost:4873"
  }
}

Docker Image

docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
Verdaccio

has 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

举报

相关推荐

0 条评论