An open API service indexing awesome lists of open source software.

https://github.com/nemanjam/verdaccio-docker


https://github.com/nemanjam/verdaccio-docker

Last synced: 18 days ago
JSON representation

Awesome Lists containing this project

README

          

# Verdaccio Docker

## Installation

```bash
# set Docker user for storage folder
# ~/.bashrc
export MY_UID=$(id -u)
export MY_GID=$(id -g)

# run, go to http://localhost:4873/
docker compose up -d
```

## Create local user

```bash
# create user (user from config.yml fails currently)
npm adduser --registry http://localhost:4873
# user: admin, pass: 123456, email: admin@example.com
# login in ui
```

## Publish package locally

```bash
# from the package
npm publish --registry http://localhost:4873
```

## Install local package

### Scope level

```bash
# set project-level .npmrc
# ~/Desktop/my-project/.npmrc
@my-org:registry=http://localhost:4873

# Note: you must have entire dependency tree for @my-org scope in local Verdaccio
# with specified versions, "@my-org/my-package": "workspace:*", will fail

# Solution: easiest, go to my-package/node_modules/@my-org and publish all dependencies from there
npm publish --registry http://localhost:4873
```

### Single package level

```bash
npm install my-package --registry=http://localhost:4873
# Todo: this will fail, install with 2 registries error

```

## Unpublish package

```bash
# all versions
npm unpublish my-package --registry http://localhost:4873 --force

# specific version
npm unpublish my-package@1.2.3 --registry http://localhost:4873 --force

```

## Todo:

- Set user/password/email in `config.yaml`
- Resolve just a single package from Verdaccio (including its dependencies)

## References

- Only the basics with Docker https://medium.com/havelsan/how-to-publish-custom-npm-packages-to-a-private-local-registry-using-verdaccio-on-docker-0494fb5938ab