Background
My organization has two registries of the same name (say my-org
); one is public and is hosted via NPM, and the other one is private and hosted in GitHub. Unfortunately, there is no registry mirroring between the two, and internal packages that require an npmAuthToken
are published to the private one, while the others to public.
Current Status
We are currently in a process of migrating to Yarn v3 and initialized our .yarnrc.yml
like:
nodeLinker: node-modules
npmScopes:
"my-org":
npmAlwaysAuth: true
npmAuthToken: ${MY_NPM_AUTH_TOKEN-fallback}
npmRegistryServer: https://npm.pkg.github.com # URL for private registry
... and for the sake of simplicity our package.json
contain these two dependencies that needs to be installed:
@my-org/public-pkg
(hosted in NPM publicly)@my-org/private-pkg
(hosted in GitHub privately)
Problem
Since the yarnrc.yml
is configured to look in the private registry for everything with @my-org/*
pattern, it fails to retrieve the @my-org/public-pkg
package, when ideally it should look for it in the public registry as a fallback first before eventually failing.
Question
- Does anybody know if there's a way to override scope names inside
.yarnrc.yml
or if there's a workaround for this? Just curious. - Or is the only solution is to mirror these repositories from public towards private?