Verdaccio is a proxy and by default links the public registry.
uplinks: npmjs: url: https://registry.npmjs.org/
You can link multiples registries, the following document will drive you throught some helpful configurations.
Using Asociating Scope
The unique way to access multiple registries using the
.npmrc is the scope feature as follows:
// .npmrc registry=htts://registry.npmjs.org :registry=http://localhost:4873
This approache is valid, but comes with several dissadventages:
- It only works with scopes
- Scope must match, no Regular Expressions are allowed
- One scope cannot fetch from multiple registries
- Tokens/passwords must be defined within
.npmrcand checked in into the repo.
See a full example here.
Linking a Registry
Link a registry is fairly simple, first, define a new section in the
uplinks section, note the order here is irrelevant.
uplinks: private: url: https://private.registry.net/npm ... [truncated] ... 'webpack': access: $all publish: $authenticated proxy: private
proxy section to define the selected registry you want to proxy.
Linking Multiples Registry
uplinks: server1: url: https://server1.registry.net/npm server2: url: https://server2.registry.net/npm ... [truncated] ... 'webpack': access: $all publish: $authenticated proxy: server1 server2
Verdaccio supports multiples registries on the
proxy field, the request will be resolved with the first in the list, if
fails, it will try with the next in the list and so on.
Having a full Offline Registry is completely possible, if you don't want any connectivity with external remotes you can do the following.
auth: htpasswd: file: ./htpasswd uplinks: packages: '@my-company/*': access: $all publish: none '@*/*': access: $all publish: $authenticated '**': access: $all publish: $authenticated
proxy fields within each section of
packages. The registry will became full offline.