I have a local nexus server, I\'d like yarn to look through it before going online, basically prefer-offline
yarn install --prefer-offline --cache-fol
Heads up!
If you define your publishConfig.registry
in package.json
:
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
It will still override registry, even if --registry
param was given to yarn publish
!
You can use .yarnrc
file & add registry "<your repo URL>"
Refer - yarnrc
yarn config set registry http://nexus.local/repository/npm-group/
. If required by your Nexus configuration, authenticate yarn: yarn login
.Also be wary of yarn using any npm config you might have over it's own: https://github.com/yarnpkg/yarn/issues/4862
You can set a different registry in yarn by using the following command:
yarn config set registry <url-to-your-registry>
Verify that it has been set by typing the following command:
yarn config get registry
For a one-off change in registry you can use the variable YARN_REGISTRY
like this:
YARN_REGISTRY="<url-to-your-registry>" yarn config get registry
or
YARN_REGISTRY="<url-to-your-registry>" yarn publish