Currently, I am facing a challenge while setting up Yarn 0.17.9 in our environment due to issues with our registry setup. Our environment involves two registries - the official npmjs registry and our own internal network registry (Sinopia).
The main issue arises when we try to pull packages from either registry using the --registry flag in npm install
. However, the problem occurs because the yarn add
command does not have a --registry option, making it difficult to set a custom registry globally with fallback to npmjs. I attempted to use the .npmrc
file but it only allows one registry for npm/yarn within a project. Additionally, the .yarnrc
file does not seem to be effective and is overridden by the .npmrc
.
Is there a way to specify two registries, with a fallback to the second registry if the package is not found in the first one? Alternatively, is there a method to define a different npm registry for each individual package?